New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cls/rgw: fix the bug when trim usage by specifying user #38123
Conversation
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
src/cls/rgw/cls_rgw.cc
Outdated
} | ||
|
||
rgw_user* puser = (e.payer.empty() ? &e.owner : &e.payer); // copy from rgw_user_usage_log_add | ||
if (by_user && user_key != puser->to_str()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this stopping the iteration--and returning a value for the current iterator position--when the users do not match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is,but no worry. when i search testuser's usage i will have plenty omap keys like testuser_0XXX and testuser__0XXX,becauser digital is less than letter '_',so the correct user's usage is always in the first half;when i search the usage of testuser__ i only get omap keys like testuser__0XXX without omap key like testuser_0XXX.i didnt change the return logic here which assume that the correct answer is always in the first half.
src/cls/rgw/cls_rgw.cc
Outdated
@@ -3170,13 +3170,13 @@ static int usage_iterate_range(cls_method_context_t hctx, uint64_t start, uint64 | |||
return 0; | |||
} | |||
|
|||
ret = usage_record_decode(iter->second, e); | |||
ret = usage_record_decode(iter->second, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ws change is unecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore this, forgot to delete it
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
when trim usage by specifying user, it is possible to trim other users’ usage.
Fixes:https://tracker.ceph.com/issues/48208
Signed-off-by: chengwu liang liangchengw@chinatelecom.cn
New PR from #38035