}
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;
}
list_state.meta.content_type = content_type;
librados::IoCtx head_obj_ctx; // initialize to data pool so we can get pool id
- const bool head_pool_found =
- get_obj_head_ioctx(dpp, bucket_info, obj, &head_obj_ctx);
- if (head_pool_found) {
- list_state.ver.pool = head_obj_ctx.get_id();
- list_state.ver.epoch = astate->epoch;
- } else {
+ int ret = get_obj_head_ioctx(dpp, bucket_info, obj, &head_obj_ctx);
+ if (ret < 0) {
ldpp_dout(dpp, 0) << __PRETTY_FUNCTION__ <<
" WARNING: unable to find head object data pool for \"" <<
obj << "\", not updating version pool/epoch" << dendl;
+ } else {
+ list_state.ver.pool = head_obj_ctx.get_id();
+ list_state.ver.epoch = astate->epoch;
}
if (astate->obj_tag.length() > 0) {