]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
Fix usage log issues caused by incorrect form of name-by-user keys 65329/head
authorYixin Jin <yjin@akamai.com>
Mon, 25 Aug 2025 20:38:57 +0000 (20:38 +0000)
committermheler <mheler@akamai.com>
Tue, 30 Sep 2025 16:01:35 +0000 (11:01 -0500)
commit674d42d9023c4bb4bd022257716348f12627274c
tree9a12e770dd21440a09c01ace419eaa57eb6822c2
parentcb24ff75f1bbc48eb9d92ee003c6aa8189ead6dc
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>
PendingReleaseNotes
doc/radosgw/admin.rst
src/cls/rgw/cls_rgw.cc
src/common/options/rgw.yaml.in
src/test/cls_rgw/test_cls_rgw.cc