]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge pull request #57560 from ceph/wip-lusov-asok-async-reef
authorMilind Changire <mchangir@users.noreply.github.com>
Wed, 29 Jan 2025 10:55:12 +0000 (16:25 +0530)
committerGitHub <noreply@github.com>
Wed, 29 Jan 2025 10:55:12 +0000 (16:25 +0530)
reef: mds: don't stall the asok thread for flush commands

1  2 
src/mds/MDSRank.cc
src/mds/MDSRank.h

index 491940639a42a744b5e9b233329ac78b8e8641c5,fa2a1bbb0c4a7f6b3358589aef13fd31d7cbd171..9ca24346e58bca032cb9177724534440611bfb07
@@@ -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;
Simple merge