]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: Reread sync status after acquiring lock in `RGWDataSyncCR`
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 11 Aug 2022 22:19:59 +0000 (18:19 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 11 Jan 2023 06:35:58 +0000 (01:35 -0500)
If someone else got there first, we won't smash their work.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/driver/rados/rgw_data_sync.cc

index d11838495bf86c4aed665cac0cac0e937d944678..2f8f079e9ad31838c96722bef8368d62cb59fb05 100644 (file)
@@ -2290,6 +2290,13 @@ public:
          yield set_sleeping(true);
        }
        tn->log(5, "acquired data sync status lease");
+
+       // Reread sync status now that we've acquired the lock!
+       yield call(new RGWReadDataSyncStatusCoroutine(sc, &sync_status, objvs));
+       if (retcode < 0) {
+         tn->log(0, SSTR("ERROR: failed to fetch sync status, retcode=" << retcode));
+         return set_cr_error(retcode);
+       }
       }
 
       /* state: init status */