]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw multisite: fix the increamtal bucket sync init
authorZengran Zhang <zhangzengran@h3c.com>
Wed, 19 Oct 2016 09:05:27 +0000 (17:05 +0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 9 Nov 2016 14:24:40 +0000 (15:24 +0100)
in the `RGWBucketShardFullSyncCR::operate`, inc_marker will assigned with remote bilog's max_marker.
but the sync_status's inc_marker cant be assigned.so the next step inc sync will always sync
from null log,which means at beginning log.

Fixes: http://tracker.ceph.com/issues/17624
Signed-off-by: Zengran Zhang <zhangzengran@h3c.com>
(cherry picked from commit 0d928c26408f2fa0b276304c4c00e9c41e0777fa)

src/rgw/rgw_data_sync.cc

index 101ddb0bdf3529fb5095ac8fc99bfdcc2e909ca4..af97a95b956b9a9a679212f1ab3cd79c8b2a62fb 100644 (file)
@@ -1642,13 +1642,14 @@ class RGWInitBucketShardSyncStatusCoroutine : public RGWCoroutine {
 
   string lock_name;
   string cookie;
-  rgw_bucket_shard_sync_info status;
+  rgw_bucket_shard_sync_info& status;
 
   bucket_index_marker_info info;
 public:
   RGWInitBucketShardSyncStatusCoroutine(RGWDataSyncEnv *_sync_env,
-                                        const rgw_bucket_shard& bs)
-    : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), bs(bs) {
+                                        const rgw_bucket_shard& bs,
+                                        rgw_bucket_shard_sync_info& _status)
+    : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), bs(bs), status(_status) {
     store = sync_env->store;
     lock_name = "sync_lock";
 
@@ -1709,7 +1710,8 @@ public:
 
 RGWCoroutine *RGWRemoteBucketLog::init_sync_status_cr()
 {
-  return new RGWInitBucketShardSyncStatusCoroutine(&sync_env, bs);
+  rgw_bucket_shard_sync_info sync_status;
+  return new RGWInitBucketShardSyncStatusCoroutine(&sync_env, bs, sync_status);
 }
 
 template <class T>
@@ -2640,8 +2642,7 @@ int RGWRunBucketSyncCoroutine::operate()
 
     yield {
       if ((rgw_bucket_shard_sync_info::SyncState)sync_status.state == rgw_bucket_shard_sync_info::StateInit) {
-        call(new RGWInitBucketShardSyncStatusCoroutine(sync_env, bs));
-        sync_status.state = rgw_bucket_shard_sync_info::StateFullSync;
+        call(new RGWInitBucketShardSyncStatusCoroutine(sync_env, bs, sync_status));
       }
     }