]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add OPT_BUCKET_SYNC_RUN to gc_ops_list, so that 45166/head
authorPritha Srivastava <prsrivas@redhat.com>
Fri, 25 Feb 2022 11:00:46 +0000 (16:30 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 28 Feb 2022 08:46:10 +0000 (14:16 +0530)
gc is initialised and send_chain does not crash.

Also deleting objects inline in case gc is uninitialised.

Fixes: https://tracker.ceph.com/issues/54417
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc

index 9b252b73e386dee4e7c4a4d21e8c28cc3ca5009d..3355a6972ce29c813d0efe0c94e005c70a5d5b8c 100644 (file)
@@ -4239,7 +4239,8 @@ int main(int argc, const char **argv)
                         OPT::USER_RM,    // --purge-data
                         OPT::OBJECTS_EXPIRE,
                         OPT::OBJECTS_EXPIRE_STALE_RM,
-                        OPT::LC_PROCESS
+                        OPT::LC_PROCESS,
+       OPT::BUCKET_SYNC_RUN
     };
 
     raw_storage_op = (raw_storage_ops_list.find(opt_cmd) != raw_storage_ops_list.end() ||
index cfd28351d60f230de3015e5ccf09bc39dac8c0a2..f992532fe38747341e85a1745bb360e9eb32e953 100644 (file)
@@ -4952,10 +4952,16 @@ int RGWRados::Object::complete_atomic_modification(const DoutPrefixProvider *dpp
   }
 
   string tag = (state->tail_tag.length() > 0 ? state->tail_tag.to_str() : state->obj_tag.to_str());
-  auto ret = store->gc->send_chain(chain, tag); // do it synchronously
-  if (ret < 0) {
-    //Delete objects inline if send chain to gc fails
+  if (store->gc == nullptr) {
+    ldpp_dout(dpp, 0) << "deleting objects inline since gc isn't initialized" << dendl;
+    //Delete objects inline just in case gc hasn't been initialised, prevents crashes
     store->delete_objs_inline(dpp, chain, tag);
+  } else {
+    auto ret = store->gc->send_chain(chain, tag); // do it synchronously
+    if (ret < 0) {
+      //Delete objects inline if send chain to gc fails
+      store->delete_objs_inline(dpp, chain, tag);
+    }
   }
   return 0;
 }