From 676479354d95b1b4a95b7336db4282fa3dd78151 Mon Sep 17 00:00:00 2001 From: Shilpa Jagannath Date: Thu, 29 Aug 2024 16:45:59 -0400 Subject: [PATCH] rg/multisite: if the first shard fails to sync, we must drain and return error. Signed-off-by: Shilpa Jagannath --- src/rgw/driver/rados/rgw_data_sync.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/driver/rados/rgw_data_sync.cc b/src/rgw/driver/rados/rgw_data_sync.cc index 58f5cd0690c..8ec360b64a3 100644 --- a/src/rgw/driver/rados/rgw_data_sync.cc +++ b/src/rgw/driver/rados/rgw_data_sync.cc @@ -1702,8 +1702,12 @@ public: lease_cr, bucket_shard_cache, nullptr, error_repo, tn, false); tn->log(10, SSTR("full sync: syncing shard_id " << sid << " of gen " << each->gen)); if (first_shard) { - yield call(shard_cr); first_shard = false; + yield call(shard_cr); + if (retcode < 0) { + drain_all(); + return set_cr_error(retcode); + } } else { yield_spawn_window(shard_cr, sc->lcc.adj_concurrency(cct->_conf->rgw_data_sync_spawn_window), [&](uint64_t stack_id, int ret) { -- 2.39.5