]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: data shard sync doesn't exit on error 8095/head
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Mar 2016 01:44:50 +0000 (18:44 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Mar 2016 22:56:31 +0000 (15:56 -0700)
We don't handle the error at the top level, so no
need to exit. Just continue with the backoff mechanism.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_sync.cc
src/rgw/rgw_sync.h

index 35798b4c780c3717d53bfa806c68a2ea73266a60..96383896d297fd01bf27882b834ef1c418e08e5c 100644 (file)
@@ -1125,7 +1125,7 @@ class RGWDataSyncShardControlCR : public RGWBackoffControlCR {
 
 public:
   RGWDataSyncShardControlCR(RGWDataSyncEnv *_sync_env, rgw_bucket& _pool,
-                    uint32_t _shard_id, rgw_data_sync_marker& _marker) : RGWBackoffControlCR(_sync_env->cct),
+                    uint32_t _shard_id, rgw_data_sync_marker& _marker) : RGWBackoffControlCR(_sync_env->cct, false),
                                                       sync_env(_sync_env),
                                                      pool(_pool),
                                                      shard_id(_shard_id),
@@ -1180,6 +1180,12 @@ public:
                                                       reset_backoff(_reset_backoff) {
   }
 
+  ~RGWDataSyncCR() {
+    for (auto iter : shard_crs) {
+      iter.second->put();
+    }
+  }
+
   int operate() {
     reenter(this) {
 
@@ -1237,6 +1243,7 @@ public:
                  iter != sync_status.sync_markers.end(); ++iter) {
               RGWDataSyncShardControlCR *cr = new RGWDataSyncShardControlCR(sync_env, sync_env->store->get_zone_params().log_pool,
                                                         iter->first, iter->second);
+              cr->get();
               shard_crs_lock.Lock();
               shard_crs[iter->first] = cr;
               shard_crs_lock.Unlock();
@@ -1274,7 +1281,7 @@ class RGWDataSyncControlCR : public RGWBackoffControlCR
   uint32_t num_shards;
 
 public:
-  RGWDataSyncControlCR(RGWDataSyncEnv *_sync_env, uint32_t _num_shards) : RGWBackoffControlCR(_sync_env->cct),
+  RGWDataSyncControlCR(RGWDataSyncEnv *_sync_env, uint32_t _num_shards) : RGWBackoffControlCR(_sync_env->cct, true),
                                                       sync_env(_sync_env), num_shards(_num_shards) {
   }
 
index 4d7c4813a2d3e99a66118c131157b7ed04e3cb43..411ab4c5dd7899509b589e63a3c798c5c7cfccb5 100644 (file)
@@ -97,7 +97,9 @@ int RGWBackoffControlCR::operate() {
       }
       if (retcode < 0 && retcode != -EBUSY && retcode != -EAGAIN) {
         ldout(cct, 0) << "ERROR: RGWBackoffControlCR called coroutine returned " << retcode << dendl;
-        return set_cr_error(retcode);
+        if (exit_on_error) {
+          return set_cr_error(retcode);
+        }
       }
       if (reset_backoff) {
         backoff.reset();
@@ -108,7 +110,9 @@ int RGWBackoffControlCR::operate() {
         yield call(finisher_cr);
         if (retcode < 0) {
           ldout(cct, 0) << "ERROR: call to finisher_cr() failed: retcode=" << retcode << dendl;
-          return set_cr_error(retcode);
+          if (exit_on_error) {
+            return set_cr_error(retcode);
+          }
         }
       }
     }
@@ -1638,7 +1642,7 @@ public:
                             const std::string& period, RGWMetadataLog* mdlog,
                             uint32_t _shard_id, const rgw_meta_sync_marker& _marker,
                             std::string&& period_marker)
-    : RGWBackoffControlCR(_sync_env->cct), sync_env(_sync_env),
+    : RGWBackoffControlCR(_sync_env->cct, true), sync_env(_sync_env),
       pool(_pool), period(period), mdlog(mdlog), shard_id(_shard_id),
       sync_marker(_marker), period_marker(std::move(period_marker)),
       obj_ctx(sync_env->store) {}
index 1ab130b9a2b629cb18cb1ac7621cecd614be218c..b694269f87ec47d6b7ccd820f81c5be57ea44155 100644 (file)
@@ -126,6 +126,8 @@ class RGWBackoffControlCR : public RGWCoroutine
   RGWSyncBackoff backoff;
   bool reset_backoff;
 
+  bool exit_on_error;
+
 protected:
   bool *backoff_ptr() {
     return &reset_backoff;
@@ -140,7 +142,8 @@ protected:
   }
 
 public:
-  RGWBackoffControlCR(CephContext *_cct) : RGWCoroutine(_cct), cr(NULL), lock("RGWBackoffControlCR::lock"), reset_backoff(false) {
+  RGWBackoffControlCR(CephContext *_cct, bool _exit_on_error) : RGWCoroutine(_cct), cr(NULL), lock("RGWBackoffControlCR::lock"),
+                                                                reset_backoff(false), exit_on_error(_exit_on_error) {
   }
 
   virtual ~RGWBackoffControlCR() {