]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge PR #57560 into wip-vshankar-testing-20250113.141608-reef-debug
authorVenky Shankar <vshankar@redhat.com>
Mon, 13 Jan 2025 14:16:28 +0000 (19:46 +0530)
committerVenky Shankar <vshankar@redhat.com>
Mon, 13 Jan 2025 14:16:28 +0000 (19:46 +0530)
* refs/pull/57560/head:
mds: don't stall the asok thread for flush commands

Reviewed-by: Xiubo Li <xiubli@redhat.com>
1  2 
src/mds/MDSRank.cc

index 7d089e89b9cfd947f0342d3d7f3491c38225a6ba,fa2a1bbb0c4a7f6b3358589aef13fd31d7cbd171..e29908e9a46fc967402b2e76a4dab1bae421fda2
@@@ -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;