From: Milind Changire Date: Wed, 29 Jan 2025 10:55:12 +0000 (+0530) Subject: Merge pull request #57560 from ceph/wip-lusov-asok-async-reef X-Git-Tag: testing/wip-mchangir-testing-20250205.144241-reef-debug~34 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c5bcc64a9363c18cb5db821bb4abf2c29e3c259c;p=ceph-ci.git Merge pull request #57560 from ceph/wip-lusov-asok-async-reef reef: mds: don't stall the asok thread for flush commands --- c5bcc64a9363c18cb5db821bb4abf2c29e3c259c diff --cc src/mds/MDSRank.cc index 491940639a4,fa2a1bbb0c4..9ca24346e58 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@@ -2777,55 -2789,31 +2799,41 @@@ void MDSRankDispatcher::handle_asok_com goto out; } + auto respond = new AsyncResponse(f, std::move(on_finish)); finisher->queue( new LambdaContext( - [this, on_finish, f](int r) { - command_scrub_abort( - f, - new LambdaContext( - [on_finish, f](int r) { - bufferlist outbl; - f->open_object_section("result"); - f->dump_int("return_code", r); - f->close_section(); - on_finish(r, {}, outbl); - })); - })); + [this, respond](int r) { + std::lock_guard l(mds_lock); + scrubstack->scrub_abort(respond); + })); return; } else if (command == "scrub pause") { - if (whoami != 0) { + if (!is_active()) { + *css << "MDS is not active"; + r = -CEPHFS_EINVAL; + goto out; + } + else if (whoami != 0) { *css << "Not rank 0"; r = -CEPHFS_EXDEV; goto out; } + auto respond = new AsyncResponse(f, std::move(on_finish)); finisher->queue( new LambdaContext( - [this, on_finish, f](int r) { - command_scrub_pause( - f, - new LambdaContext( - [on_finish, f](int r) { - bufferlist outbl; - f->open_object_section("result"); - f->dump_int("return_code", r); - f->close_section(); - on_finish(r, {}, outbl); - })); - })); + [this, respond](int r) { + std::lock_guard l(mds_lock); + scrubstack->scrub_pause(respond); + })); return; } else if (command == "scrub resume") { - if (whoami != 0) { + if (!is_active()) { + *css << "MDS is not active"; + r = -CEPHFS_EINVAL; + goto out; + } + else if (whoami != 0) { *css << "Not rank 0"; r = -CEPHFS_EXDEV; goto out;