From: Abhishek Lekshmanan Date: Thu, 9 Nov 2017 14:50:56 +0000 (+0100) Subject: rgw: data sync: set num_shards when building full maps X-Git-Tag: v12.2.3~200^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=442120898b8abf22fcd66e06eb8607481653c890;p=ceph.git rgw: data sync: set num_shards when building full maps When radosgw-admin data sync init is called on a cluster, the next run of rgw crashes as when it processes ListBucketIndexesCR, num_shards isn't set which is later referenced in ListBucketIndexesCR. Setting the n sync_info.num_shards correctly to handle this case Fixes: http://tracker.ceph.com/issues/22083 Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 4015a57c473d896164b0617be93777d0947a9576) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index daaffb7cde9e..cc300b4fd37f 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1481,6 +1481,7 @@ public: if ((rgw_data_sync_info::SyncState)sync_status.sync_info.state == rgw_data_sync_info::StateBuildingFullSyncMaps) { /* call sync module init here */ + sync_status.sync_info.num_shards = num_shards; yield call(data_sync_module->init_sync(sync_env)); if (retcode < 0) { ldout(sync_env->cct, 0) << "ERROR: sync module init_sync() failed, retcode=" << retcode << dendl;