]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #47728 from yuvalif/wip-yuval-cont-lease
authorYuval Lifshitz <ylifshit@redhat.com>
Sun, 28 Aug 2022 07:44:07 +0000 (10:44 +0300)
committerGitHub <noreply@github.com>
Sun, 28 Aug 2022 07:44:07 +0000 (10:44 +0300)
rgw/multisite: check for late lease renewals

reviewed-by: cbodley

1  2 
src/rgw/rgw_data_sync.cc
src/rgw/rgw_sync.cc

index d86747b9043836c106fb7003f08ea90bfec51188,17ec3e86846a4233ffe8d1afaf27ce6b5e3e05e7..ec76e153d95861344cda20deb2053dacab0135cd
@@@ -1684,7 -1577,9 +1684,8 @@@ public
        entry_timestamp = sync_marker.timestamp; // time when full sync started
        do {
          if (!lease_cr->is_locked()) {
 -          lease_cr->go_down();
            drain_all();
+           tn->log(1, "lease is lost, abort");
            return set_cr_error(-ECANCELED);
          }
          omapvals = std::make_shared<RGWRadosGetOmapValsCR::Result>();
@@@ -1816,15 -1671,15 +1817,16 @@@ public
        marker_tracker.emplace(sc, status_oid, sync_marker, tn);
        do {
          if (!lease_cr->is_locked()) {
 -          lease_cr->go_down();
            drain_all();
+           tn->log(1, "lease is lost, abort");
            return set_cr_error(-ECANCELED);
          }
 -        current_modified.clear();
 -        inc_lock.lock();
 -        current_modified.swap(modified_shards);
 -        inc_lock.unlock();
 +      {
 +        current_modified.clear();
 +        std::unique_lock il(inc_lock);
 +        current_modified.swap(modified_shards);
 +        il.unlock();
 +      }
  
          if (current_modified.size() > 0) {
            tn->set_flag(RGW_SNS_FLAG_ACTIVE); /* actually have entries to sync */
@@@ -4355,10 -4070,16 +4359,11 @@@ int RGWBucketFullSyncCR::operate(const 
      set_status("done iterating over all objects");
  
      /* wait for all operations to complete */
 -    drain_all_cb([&](uint64_t stack_id, int ret) {
 -      if (ret < 0) {
 -        tn->log(10, "a sync operation returned error");
 -        sync_result = ret;
 -      }
 -      return 0;
 -    });
 +    drain_all_cb(capture_error(sync_result));
 +
      tn->unset_flag(RGW_SNS_FLAG_ACTIVE);
      if (lease_cr && !lease_cr->is_locked()) {
+       tn->log(1, "no lease or lease is lost, abort");
        return set_cr_error(-ECANCELED);
      }
      yield call(marker_tracker.flush());
Simple merge