Repository navigation
crimson/osd/pg: only kick off snap trimming when PGs are clean - #56998
Conversation
|
The following tests FAILED: |
Stopped at |
Yeah, not sure why it didn't continue... |
|
jenkins test make check |
|
@xxhdx1985126 Let's track there to see how frequent it is, and whether it is RBM specific. |
Matan-B
left a comment
There was a problem hiding this comment.
lgtm, one nit.
SnapTrimEvent::start() also skips the do_recover_missing stage. However, it should be expected there as we are not yet aware of any objects that should be trimmed.
Can you please add that as a comment?
Alternatively, we can also cleanup the recover_missing stage from SnapTrimEvent::start() to avoid future confusion. What do you think?
There was a problem hiding this comment.
return recover_missings(pg, coid, {coid.snap});
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
This PR can't handle the following case:
For this reason, I think we'd better model the classic OSD to only kick off snap trimmings when PGs are |
Sounds right |
|
@athanatos @Matan-B I've modified the code, please take a look again, thanks:-) |
There was a problem hiding this comment.
Is this bit still relevant? the only eagain return case was removed.
There was a problem hiding this comment.
The commit message doesn't explain the actual code change.
crimson/osd/pg: SnapTrimEvent to support interrupts
SnapTrimEvent operations are scheduled from `PG::on_active_actmap()` using a `seastar::do_until` loop.
This commit replaces the loop type into an `interruptor::repeat` and SnapTrimEvent are now scheduled by `start_operation_may_interrupt`.
Previously, `SnapTrimEvent::start` handled interruptions by returning a `crimson::ct_error::eagain::make();`.
Now, the errorator is directly returned via the `snap_trim_event_ret_t` and interrupts the loop described above.
As a result, interruptions originated by interval changes are now supported by SnapTrimEvent.
| [this] { | ||
| peering_state.state_set(PG_STATE_SNAPTRIM); | ||
| publish_stats_to_osd(); | ||
| const auto to_trim = snap_trimq.range_start(); | ||
| snap_trimq.erase(to_trim); | ||
| const auto needs_pause = !snap_trimq.empty(); | ||
| return seastar::repeat([to_trim, needs_pause, this] { | ||
| logger().debug("{}: going to start SnapTrimEvent, to_trim={}", | ||
| *this, to_trim); | ||
| return shard_services.start_operation<SnapTrimEvent>( | ||
| this, | ||
| snap_mapper, | ||
| to_trim, | ||
| needs_pause | ||
| ).second.handle_error( | ||
| crimson::ct_error::enoent::handle([this] { | ||
| logger().error("{}: ENOENT saw, trimming stopped", *this); | ||
| peering_state.state_set(PG_STATE_SNAPTRIM_ERROR); | ||
| publish_stats_to_osd(); | ||
| return seastar::make_ready_future<seastar::stop_iteration>( | ||
| seastar::stop_iteration::yes); | ||
| }), crimson::ct_error::eagain::handle([this] { | ||
| logger().info("{}: EAGAIN saw, trimming restarted", *this); | ||
| return seastar::make_ready_future<seastar::stop_iteration>( | ||
| seastar::stop_iteration::no); | ||
| }) | ||
| ); | ||
| }).then([this, trimmed=to_trim] { | ||
| logger().debug("{}: trimmed snap={}", *this, trimmed); | ||
| }); | ||
| } | ||
| ).finally([this, pg_ref=std::move(pg_ref)] { | ||
| logger().debug("{}: PG::on_active_actmap() finished trimming", | ||
| *this); | ||
| peering_state.state_clear(PG_STATE_SNAPTRIM); | ||
| peering_state.state_clear(PG_STATE_SNAPTRIM_ERROR); |
There was a problem hiding this comment.
nit: This may be a good opportunity to separate the snap trim scheduling logic into a new method (out of PG::on_active_actmap()), or at least some of it.
There was a problem hiding this comment.
Previously, on interruptions - we would keep trying again (eagain) until success. This would ensure that an erased to_trim is actually trimmed. It seems that by removing the eagain case we may erase from snap_trimq without completing the trimming (on interruptions).
We should probably either erase only on success or re-adding the uncompleted to_trim on interruption.
There was a problem hiding this comment.
Yeah, will change it.
|
@Matan-B All done, please take a look again, thanks:-) |
There was a problem hiding this comment.
Why not re-use PG_STATE_SNAPTRIM? e.g peering_state.state_test(PG_STATE_SNAPTRIM)
There was a problem hiding this comment.
Um, it seems that we need to prevent PG from creating extra Nay, I didn't see that SnapTrimEvents when there's already one; on the other hand, PG_STATE_SNAPTRIM is set after reservations are done, which means there's a time interval between the creation of SnapTrimEvent and the set of PG_STATE_SNAPTRIM.PG_STATE_SNAPTRIM is set in PG::on_active_actmap(). Will reuse it.
There was a problem hiding this comment.
Is snap_trim_ertr needed? It seems like the last user is removed, if so we can cleanup.
There was a problem hiding this comment.
nit: "pg is not clean, skipping snap trim"
SnapTrimEvent operations are scheduled from `PG::on_active_actmap()` using a `seastar::do_until` loop. This commit replaces the loop type into an `interruptor::repeat` and SnapTrimEvent are now scheduled by `start_operation_may_interrupt`. Previously, `SnapTrimEvent::start` handled interruptions by returning a `crimson::ct_error::eagain::make();`. Now, the errorator is directly returned via the `snap_trim_event_ret_t` and interrupts the loop described above. As a result, interruptions originated by interval changes are now supported by SnapTrimEvent. Signed-off-by: Xuehan Xu <[email protected]>
|
jenkins test make check |
|
jenkins test windows |
|
jenkins test windows |
Fixes: https://tracker.ceph.com/issues/65568
Signed-off-by: Xuehan Xu [email protected]
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e