]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't store empty chains in gc 12174/head
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 14 Nov 2016 18:22:03 +0000 (10:22 -0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 24 Nov 2016 10:49:01 +0000 (11:49 +0100)
Fixes: http://tracker.ceph.com/issues/17897
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 7c8f1b9edc921711fa30345bbecea2dcd5de1229)

src/cls/rgw/cls_rgw_types.h
src/rgw/rgw_rados.cc

index cf143ce92cc09fab1426551d2f925fcc33712b45..8409f1974c53df6704646ee05c83c1f3ae2c98f6 100644 (file)
@@ -886,6 +886,10 @@ struct cls_rgw_obj_chain {
   static void generate_test_instances(list<cls_rgw_obj_chain*>& ls) {
     ls.push_back(new cls_rgw_obj_chain);
   }
+
+  bool empty() {
+    return objs.empty();
+  }
 };
 WRITE_CLASS_ENCODER(cls_rgw_obj_chain)
 
index 134e7e56ea04762d2b5c6681fc27c09011ca1a78..a95a2e244a1dd52044d16f1372a57bfc21e5ccd6 100644 (file)
@@ -7447,6 +7447,10 @@ int RGWRados::Object::complete_atomic_modification()
   cls_rgw_obj_chain chain;
   store->update_gc_chain(obj, state->manifest, &chain);
 
+  if (chain.empty()) {
+    return 0;
+  }
+
   string tag = state->obj_tag.to_str();
   int ret = store->gc->send_chain(chain, tag, false);  // do it async