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
crimson/osd/osd_operations/snaptrim_event: update PG's stats #56378
Conversation
I imitate the corresponding logic in classic 😕 |
hi @athanatos , please take a look at my PR when you have free time, thank you 😄 |
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.
Hey @guojidan, thank you for the contribution.
Commit title should be:
crimson/osd/osd_operations/snaptrim_event: update PG's stats
Also, the commit message should include:
Fixes: https://tracker.ceph.com/issues/63307
Please see: https://github.com/ceph/ceph/blob/main/SubmittingPatches.rst
} | ||
pg->get_peering_state().apply_op_stats(coid, delta_stats); |
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.
Let's move OpsExecuter::apply_stats()
logic into PG::apply_stats()
. That way both OpsExecuter
and SnapTrimObjSubEvent
will be able to call pg->apply_stats()
.
int64_t num_objects_trimmed = | ||
num_objects_before_trim - delta_stats.num_objects; | ||
pg->get_peering_state().update_stats_wo_resched([num_objects_trimmed](auto &history, auto &stats) { |
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.
Styling: indention and line length
// num_objects_before_trim - delta_stats.num_objects; | ||
//add_objects_trimmed_count(num_objects_trimmed); | ||
int64_t num_objects_trimmed = | ||
num_objects_before_trim - delta_stats.num_objects; |
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.
num_objects_before_trim
is not an entirely correct name since delta_stats
is local to each SnapTrimObjSubEvent
and is zeroed. I think that we can drop it and replace with:
if (delta_stats.num_objects < 0) {
int64_t num_objects_trimmed = std::abs(delta_stats.num_objects);
}
@Matan-B thank you so much for your review, I have made the changes according to your suggestion. 😄 |
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.
LGTM
Fixes: https://tracker.ceph.com/issues/63307 Signed-off-by: junxiang Mu <1948535941@qq.com>
Note: CC: @guojidan |
please let me try implement this, I am very willing. 😄 |
@guojidan, feel free to assign the ticket to yourself. |
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 needs to go through testing, but it should probably wait until the scrub errors shake out. I'll add it to my test branch.
jenkins test make check arm64 |
Nicely done, clean and to the point. |
thanks you! @Matan-B @athanatos |
Fixes: https://tracker.ceph.com/issues/63307
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
x
between the brackets:[x]
. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows
jenkins test rook e2e