Fix usage log issues caused by incorrect form of name-by-user keys
1. The old name-by-user keys start with user/payer IDs. If those IDs
start with '0', the resulting name-by-user keys could fall within
the range of name-by-time keys, which has the prefix of '0' followed
by 11 digits of the epoch. The intermingle of name-by-user and
name-by-time keys causes the usage function to mistakenly treat
name-by-user usage logs as name-by-time logs. This leads issues like
failure to trim old logs because some name-by-user logs with later
epoch listed BEFORE name-by-time logs with earlier epoch, causing
the trim logic to stop prematurally.
2. To fix the above issue, adding prefix '~' in name-by-user keys when
the user/payer IDs starting with '0'.
3. Introduce a rgw config option to indicate the need to deal with
the co-existence of old and new name-by-user keys. Since handling
both keys incurs performance penalty, this option helps avoid it
once the cluster no longer has the old keys.
4. usage_iterate_range() is splitted to usage_iterate_range_by_user()
and usage_iterate_range_by_time() as only the former needs to deal
with the potential co-existence of old and new name-by-user keys.
This split intends to simplify the logic.
5. "usage_basic" test in test_cls_rgw.cc is adapted slightly to reproduce
the issue mentioned above.
6. A new test case "usage_key_transition" is added to test the handling
of the co-existence of old and new keys.
Signed-off-by: Matthew N Heler <mheler@akamai.com>