Skip to content

Commit 5e9dcaf

Browse files
authored
Merge pull request ceph#59536 from smanjara/rgw-full-sync-cr
rg/multisite: handle errors properly in RGWDataFullSyncSingleEntryCR() Reviewed-by: Casey Bodley <[email protected]>
2 parents abfff2b + 34f8306 commit 5e9dcaf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/rgw/driver/rados/rgw_data_sync.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,8 +1702,12 @@ class RGWDataFullSyncSingleEntryCR : public RGWCoroutine {
17021702
lease_cr, bucket_shard_cache, nullptr, error_repo, tn, false);
17031703
tn->log(10, SSTR("full sync: syncing shard_id " << sid << " of gen " << each->gen));
17041704
if (first_shard) {
1705-
yield call(shard_cr);
17061705
first_shard = false;
1706+
yield call(shard_cr);
1707+
if (retcode < 0) {
1708+
drain_all();
1709+
return set_cr_error(retcode);
1710+
}
17071711
} else {
17081712
yield_spawn_window(shard_cr, sc->lcc.adj_concurrency(cct->_conf->rgw_data_sync_spawn_window),
17091713
[&](uint64_t stack_id, int ret) {
@@ -1862,12 +1866,7 @@ class RGWDataFullSyncShardCR : public RGWDataBaseSyncShardCR {
18621866
error_repo, entry_timestamp, lease_cr,
18631867
bucket_shard_cache, &*marker_tracker, tn),
18641868
sc->lcc.adj_concurrency(cct->_conf->rgw_data_sync_spawn_window),
1865-
[&](uint64_t stack_id, int ret) {
1866-
if (ret < 0) {
1867-
retcode = ret;
1868-
}
1869-
return retcode;
1870-
});
1869+
std::nullopt);
18711870
}
18721871
sync_marker.marker = iter->first;
18731872
}
@@ -2551,6 +2550,7 @@ class RGWDataSyncCR : public RGWCoroutine {
25512550
}
25522551

25532552
notify_stack->cancel();
2553+
drain_all();
25542554

25552555
return set_cr_done();
25562556
}

0 commit comments

Comments
 (0)