]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge PR #53301 into wip-vshankar-testing-20240604.051731-debug testing/wip-vshankar-testing-20240604.051731-debug
authorVenky Shankar <vshankar@redhat.com>
Tue, 4 Jun 2024 05:18:11 +0000 (10:48 +0530)
committerVenky Shankar <vshankar@redhat.com>
Tue, 4 Jun 2024 05:18:11 +0000 (10:48 +0530)
* refs/pull/53301/head:
qa: adding test for preventing scrub when mds is inactive
mds: prevent scrub start for standby-replay MDS

Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
1  2 
qa/tasks/cephfs/test_scrub_checks.py
src/mds/MDSRank.cc

Simple merge
index 3001d50a233ff412a09a86fe3107265f801d70d2,e4807a14f89205b1282299c4e3f9955416ad345e..e8f74de628c248246b4e4523111df98f664d2c8b
@@@ -2911,31 -2783,55 +2921,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;