From 3754871e65830e772f9b902fa162853716eeb78d Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 13 Aug 2018 15:47:29 -0400 Subject: [PATCH] rgw: data sync checks whether the lease failed to renew Signed-off-by: Casey Bodley --- src/rgw/rgw_data_sync.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 28066ae954f43..8aa594b682aa9 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1314,6 +1314,11 @@ public: set_marker_tracker(new RGWDataSyncShardMarkerTrack(sync_env, status_oid, sync_marker, tn)); total_entries = sync_marker.pos; do { + if (!lease_cr->is_locked()) { + stop_spawned_services(); + drain_all(); + return set_cr_error(-ECANCELED); + } omapkeys = std::make_shared(); yield call(new RGWRadosGetOmapKeysCR(sync_env->store, rgw_raw_obj(pool, oid), sync_marker.marker, max_entries, omapkeys)); @@ -1406,6 +1411,11 @@ public: logger.log("inc sync"); set_marker_tracker(new RGWDataSyncShardMarkerTrack(sync_env, status_oid, sync_marker, tn)); do { + if (!lease_cr->is_locked()) { + stop_spawned_services(); + drain_all(); + return set_cr_error(-ECANCELED); + } current_modified.clear(); inc_lock.Lock(); current_modified.swap(modified_shards); -- 2.39.5