From 5400aab8d92b1260d331e72ae81030424a1e1797 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 19 Sep 2024 12:19:19 -0400 Subject: [PATCH] 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 --- src/cls/user/cls_user.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;