]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix radosgw-admin data sync run crash 17165/head
authorlu.shasha <lu.shasha@eisoo.com>
Tue, 27 Jun 2017 02:53:30 +0000 (10:53 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 12 Sep 2017 07:42:10 +0000 (09:42 +0200)
If sync thread have run before, then run data sync init. sync_status is still remain in rados pool. so no matter sync_status exists or not, if state is StateInit, sync_status.sync_info.num_shards should be updated.

Fixes: http://tracker.ceph.com/issues/20423
Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
(cherry picked from commit c307910d7131fc290f00bb8e33876e667afb72ec)

Conflicts:
    src/rgw/rgw_data_sync.cc (no data_sync_module or instance_id in jewel)

src/rgw/rgw_data_sync.cc

index fb0ab49b866dcb089e0956f4fec0d6d007c60d93..7e68df80a2d92f79c90c19fd98456a0f57538fbe 100644 (file)
@@ -1385,9 +1385,7 @@ public:
       /* read sync status */
       yield call(new RGWReadDataSyncStatusCoroutine(sync_env, &sync_status));
 
-      if (retcode == -ENOENT) {
-        sync_status.sync_info.num_shards = num_shards;
-      } else if (retcode < 0 && retcode != -ENOENT) {
+      if (retcode < 0 && retcode != -ENOENT) {
         ldout(sync_env->cct, 0) << "ERROR: failed to fetch sync status, retcode=" << retcode << dendl;
         return set_cr_error(retcode);
       }
@@ -1395,6 +1393,7 @@ public:
       /* state: init status */
       if ((rgw_data_sync_info::SyncState)sync_status.sync_info.state == rgw_data_sync_info::StateInit) {
         ldout(sync_env->cct, 20) << __func__ << "(): init" << dendl;
+        sync_status.sync_info.num_shards = num_shards;
         yield call(new RGWInitDataSyncStatusCoroutine(sync_env, num_shards, &sync_status));
         if (retcode < 0) {
           ldout(sync_env->cct, 0) << "ERROR: failed to init sync, retcode=" << retcode << dendl;