From be253403d102dfc32200d49c536af9eea5464381 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 23 Nov 2020 18:06:26 -0500 Subject: [PATCH] rgw: temporarily disable calls to defer_gc() in RGWGetObj cls_rgw_gc_queue_update_entry() is known to cause data loss when called on objects that have not actually been scheduled for garbage collection RGWGetObj is the only caller, and uses defer_gc() when reads are taking a long time compared to rgw_gc_obj_min_wait. if an object has since been deleted and submitted for garbage collection, this allows RGWGetObj to defer that gc until the entire read completes by disabling these calls to defer_gc(), very long reads (longer than 1hr, with default configuration) may fail if the object gets deleted, and a retry will result in a 404 Not Found error as expected Fixes: https://tracker.ceph.com/issues/47866 Signed-off-by: Casey Bodley (cherry picked from commit 94df9cd37a1ca457130f90803281b166a5fa7eef) --- src/rgw/rgw_op.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index e816d84a51d59..20f7b62e54b26 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2127,16 +2127,8 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl) int RGWGetObj::get_data_cb(bufferlist& bl, off_t bl_ofs, off_t bl_len) { - /* garbage collection related handling */ - utime_t start_time = ceph_clock_now(); - if (start_time > gc_invalidate_time) { - int r = store->getRados()->defer_gc(s->obj_ctx, s->bucket_info, obj, s->yield); - if (r < 0) { - ldpp_dout(this, 0) << "WARNING: could not defer gc entry for obj" << dendl; - } - gc_invalidate_time = start_time; - gc_invalidate_time += (s->cct->_conf->rgw_gc_obj_min_wait / 2); - } + /* garbage collection related handling: + * defer_gc disabled for https://tracker.ceph.com/issues/47866 */ return send_response_data(bl, bl_ofs, bl_len); } -- 2.39.5