Repository navigation
Conversation
f2619dd to
cb61103
Compare
|
hi @Matan-B @athanatos , please review this PR if you have free time 😃 |
|
@guojidan Apologies for the delay -- I'll try to get to this next week. |
athanatos
left a comment
There was a problem hiding this comment.
I'd like to avoid creating as much crimson-specific implementation as this PR has. I think it should be possible to use a seastar::async environment to wrap the call to the normal ::run(). Additionally, I think @Matan-B added some testing support for this in classic. I'd like to see that extended to crimson as part of this PR so that we get test coverage in our normal integration test runs.
There was a problem hiding this comment.
I really don't want to "on_active_actmap()" when we aren't activating a map.
There was a problem hiding this comment.
This needs to be run in a seastar::async context. As written, I think it will simply crash.
There was a problem hiding this comment.
This should probably be conditional on a config option. Does classic actually do this unconditionally?
There was a problem hiding this comment.
yes, but it is not unconditional, it will compute the time interval in the method deep_scrub_purged_snaps.
There was a problem hiding this comment.
Classic is calling this based on:
if (next < ceph_clock_now()) {
dout(20) << __func__ << " last_purged_snaps_scrub " << last
<< " next " << next << " ... now" << dendl;
scrub_purged_snaps();
If you would prefer to call this unconditionally here, a suitable name would probably be maybe_deep_scrub_purged_snaps
There was a problem hiding this comment.
It makes sense. Mainly, I don't want to place the logical judgment of whether to execute scrub in the tick_timer.
There was a problem hiding this comment.
The OSDriver variant for WITH_SEASTAR uses green_get() to suspend a green thread within a seastar::async environment to avoid needing to do as large a rewrite as you have done here. Can we do that here as well? I'm not worried about the performance cost of the extra stack swaps for SnapMapper::Scrubber if it allows us to avoid adding more code as it's purely a debug interface.
OK,I will re-implement. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Matan-B
left a comment
There was a problem hiding this comment.
I think @Matan-B added some testing support for this in classic. I'd like to see that extended to crimson as part of this PR so that we get test coverage in our normal integration test runs.
hi @Matan-B ,do you known where the test case file is, I can't find it. 😢
The testing added was chance_reset_purged_snaps_last in ceph_manager.py (thrash tests).
See: #53579
SnapMapper::Scrubber used PSN keys to perform scrubbing. Once those keys are missing from the OSD, reset_purged_snaps_last was introduced to re-create them.
If you would like to test SnapMapper::Scrubber actual trimming you can try:
- Create clone object
- Leak the clone object
- call scrub_purged_snaps
See: https://gist.github.com/Matan-B/83157a6119587eadbf9998f960827cef for similar reproducer. ("Omit OSD purged_snaps keys" is not relevant here - you can skip it).
I think it should be possible to use a seastar::async environment to wrap the call to the normal ::run()
I agree with Sam's comment above, we should try re-using common (Classic/Crimson) SnapMapper logic as much as possible.
See #58868 for similar common usage.
|
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. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
|
Can one of the admins verify this patch? |
thank you for your reply, but ceph-kvstore-tools do not support crimson yet, i am looking for another way to test this pr |
Ah, perhaps it's time to support offline tools for Crimson. I'll follow up with a tracker. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
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. |
9aa209b to
5d613ba
Compare
|
This PR is ready for review. It has passed this test: https://gist.github.com/Matan-B/83157a6119587eadbf9998f960827cef. The offline tool uses this PR: #63604. |
Matan-B
left a comment
There was a problem hiding this comment.
Great work, left some comments!
There was a problem hiding this comment.
nit: I'm re-writing AdminSocket hooks to use the new debugging macro and coroutines in an upcoming PR.
#63523
There was a problem hiding this comment.
Classic is calling this based on:
if (next < ceph_clock_now()) {
dout(20) << __func__ << " last_purged_snaps_scrub " << last
<< " next " << next << " ... now" << dendl;
scrub_purged_snaps();
If you would prefer to call this unconditionally here, a suitable name would probably be maybe_deep_scrub_purged_snaps
There was a problem hiding this comment.
This shouldn't be run in an seastar::async block, Crimson has a dedicated futurized osdriver in SnapMapper.
There was a problem hiding this comment.
Because the OSDriver::get_next_or_current method requires the use of .get(), record_purged_snaps needs to be wrapped with seastar::async. Otherwise, an error will occur: /home/dandan/code/c++/ceph/src/seastar/src/core/future.cc:271: void seastar::internal::future_base::do_wait(): Assertion thread failed.
like @athanatos said : #57491 (comment)
There was a problem hiding this comment.
Ah, let's add a comment above the seastar::async block to emphasize the rationale.
There was a problem hiding this comment.
Crimson trimming doesn't work with kick_snap_trim same as classic.
This is already implemented, please see SnapTrimObjSubEvent and SnapTrimEvent which are being called from PG::trim_snap. I think that we should be able to reuse the existing logic.
There was a problem hiding this comment.
Maybe the method name is confusing, so I'll change it to trim_snaps. The main purpose of this method is to cyclically call PG::trim_snap to traverse and delete each snapid_t. My idea is that scrub_purged_snaps may scan out multiple snapids that need trimming. If the PG supports batch trimming of snaps, there will be no need to traverse and call PG::trim_snap in scrub_purged_snaps.
There was a problem hiding this comment.
Let's reuse this logic in on_active_actmap instead of copying twice. Added a comment in last review.
There was a problem hiding this comment.
Let's introduce purged_snaps as a member instead of changing the return type here.
Sounds promising! Can you explain how the offline tool uses it? |
fixes: https://tracker.ceph.com/issues/65478 Signed-off-by: junxiang Mu <[email protected]> Signed-off-by: guojidan <[email protected]> s
Matan-B
left a comment
There was a problem hiding this comment.
The implementation looks good! The last commit should not remove the interruption support.
There was a problem hiding this comment.
Ah, let's add a comment above the seastar::async block to emphasize the rationale.
| } | ||
| } | ||
|
|
||
| void PG::trim_snaps() |
There was a problem hiding this comment.
Since this is the same logic as in PG::on_active_actmap() can we reuse it there? at least the common parts.
| class DumpSlowestHistoricOpsHook; | ||
| class DumpRecoveryReservationsHook; | ||
| class ScrubPurgedSnapsHook; | ||
| class ResetPurgedSnapsLastHook; |
There was a problem hiding this comment.
Let's either squash this or move the implementation of the command here (preferably the latter :)
| pg_shard_manager.get_meta_coll().collection(), | ||
| std::move(t)).then([] { |
There was a problem hiding this comment.
nit: Doesn't appear to belong here.
| void set_ready_to_merge_target(eversion_t lu, epoch_t les, epoch_t lec) final {} | ||
| void set_ready_to_merge_source(eversion_t lu) final {} | ||
|
|
||
| // seastar::future<> scrub_purged_snaps(); |
| CRIMSON_DEBUG("OSDriver::{}", __func__); | ||
| using crimson::os::FuturizedStore; | ||
| return interruptor::green_get(os->omap_get_values( | ||
| return os->omap_get_values( |
There was a problem hiding this comment.
The reason we use green_get is to support interrupts, we can't remove this usage.
There seem to be a bug around the call to reset which expects ref count to be more than 1 - which makes sense.
Perhaps we are missing a ref_count++? There are many logs around ceph_subsys_crimson_interrupt I would suggest to enable them and see what is the missing bit.
There was a problem hiding this comment.
My understanding is as follows: green_get itself should have no bugs. Its original design intention is to run methods decorated by the interruptor, such as interruptor::with_interruption. If this is the case, calling reset first in green_get will not cause an error. In our method, however, the omap_get_values method is just an ordinary future, so there is no need to use green_get.
There was a problem hiding this comment.
Your observation is correct. Let's change omap_get_values to return an interruptible errorator then instead. The current return value is read_errorator::future<omap_values_t> particularly read_errorator which is a non-interruption (vanilla future). In order for us to support interruptions and in turn use green_get properly - we should change it to an read_ierrorator. There few examples for this around the code base but this should work:
using read_ierrorator =
::crimson::interruptible::interruptible_errorator<
IOInterruptCondition, read_errorator>;
| return to_test.substr(0, MAPPING_PREFIX.size()) == MAPPING_PREFIX; | ||
| } | ||
|
|
||
| bool SnapMapper::is_purged(const string &to_test) |
There was a problem hiding this comment.
Does it belong here? If so, please mention why in the commit message.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
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. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
|
Hey, any chance I could pick this up? |
fixes: https://tracker.ceph.com/issues/65478
fixes: https://tracker.ceph.com/issues/69626
fixes: https://tracker.ceph.com/issues/71705
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