From: Yuval Lifshitz Date: Sun, 28 Aug 2022 07:44:07 +0000 (+0300) Subject: Merge pull request #47728 from yuvalif/wip-yuval-cont-lease X-Git-Tag: v18.0.0~158 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30078cd2924d14bafd3f87c06de0a371fb0185b3;p=ceph.git Merge pull request #47728 from yuvalif/wip-yuval-cont-lease rgw/multisite: check for late lease renewals reviewed-by: cbodley --- 30078cd2924d14bafd3f87c06de0a371fb0185b3 diff --cc src/rgw/rgw_data_sync.cc index d86747b90438,17ec3e86846a..ec76e153d958 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@@ -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(); @@@ -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());