From: Casey Bodley Date: Thu, 19 Sep 2024 16:19:19 +0000 (-0400) Subject: cls/user: reset stats only returns marker when truncated X-Git-Tag: v19.2.1~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bf6a70b0b704cebc00a1832a773d192d3cb6390;p=ceph.git cls/user: reset stats only returns marker when truncated the returned marker is a bucket name. when bucket names are long, the response can overflow the 64-byte limit on responses to write operations with librados::OPERATION_RETURNVEC. this leads to errors like: > ERROR: could not reset user stats: (75) Value too large for defined data type however, the client only needs this marker string to resume listing after a truncated response. if the listing is not truncated, we can omit the marker to save space in general, users will have less than MAX_ENTRIES=1000 buckets, so won't get truncated listings Fixes: https://tracker.ceph.com/issues/51786 Signed-off-by: Casey Bodley (cherry picked from commit 5400aab8d92b1260d331e72ae81030424a1e1797) --- diff --git a/src/cls/user/cls_user.cc b/src/cls/user/cls_user.cc index 0447bf33a2c..592f304fc71 100644 --- a/src/cls/user/cls_user.cc +++ b/src/cls/user/cls_user.cc @@ -482,10 +482,6 @@ static int cls_user_reset_stats2(cls_method_context_t hctx, add_header_stats(&ret.acc_stats, e); } - /* try-update marker */ - if(!keys.empty()) - ret.marker = (--keys.cend())->first; - if (! ret.truncated) { buffer::list bl; header.last_stats_update = op.time; @@ -500,6 +496,10 @@ static int cls_user_reset_stats2(cls_method_context_t hctx, return rc; } + /* try-update marker */ + if(!keys.empty()) + ret.marker = (--keys.cend())->first; + /* return partial result */ encode(ret, *out); return 0;