From d05319babed3f3c4dc6d15b0584cd51cea1d6258 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 29 Mar 2023 10:57:04 -0400 Subject: [PATCH] rgw: set init_check_compat when bucket sync status doesn't exist Signed-off-by: Casey Bodley (cherry picked from commit 00f623e28960300babae52ed78e5a27b3b235c64) --- src/rgw/driver/rados/rgw_data_sync.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rgw/driver/rados/rgw_data_sync.cc b/src/rgw/driver/rados/rgw_data_sync.cc index 0e9d511342b27..1e8c916cb3e45 100644 --- a/src/rgw/driver/rados/rgw_data_sync.cc +++ b/src/rgw/driver/rados/rgw_data_sync.cc @@ -5692,6 +5692,12 @@ int RGWSyncBucketCR::operate(const DoutPrefixProvider *dpp) yield call(new ReadCR(dpp, env->driver, status_obj, &bucket_status, false, &objv)); if (retcode == -ENOENT) { + // if the full sync status object didn't exist yet, run the backward + // compatability logic in InitBucketFullSyncStatusCR below. if it did + // exist, a `bucket sync init` probably requested its re-initialization, + // and shouldn't try to resume incremental sync + init_check_compat = true; + // use exclusive create to set state=Init objv.generate_new_write_ver(cct); yield call(new WriteCR(dpp, env->driver, status_obj, bucket_status, &objv, true)); -- 2.39.5