From: J. Eric Ivancich Date: Wed, 20 Feb 2019 16:18:51 +0000 (-0500) Subject: rgw: resolve bug where marker was not advanced during garbage collection X-Git-Tag: v14.2.0~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1101f4c34cbc784d8521325018f7f1d347416a60;p=ceph.git rgw: resolve bug where marker was not advanced during garbage collection This resolves a bug where no GC progress could be made under certain rare circumstances. This also adds additional logging. Signed-off-by: J. Eric Ivancich --- diff --git a/src/rgw/rgw_gc.cc b/src/rgw/rgw_gc.cc index 87a98e469af10..1d9292423a5d1 100644 --- a/src/rgw/rgw_gc.cc +++ b/src/rgw/rgw_gc.cc @@ -254,11 +254,15 @@ done: ++index; } } -}; +}; // class RGWGCIOManger int RGWGC::process(int index, int max_secs, bool expired_only, RGWGCIOManager& io_manager) { + ldpp_dout(this, 20) << "RGWGC::process entered with GC index_shard=" << + index << ", max_secs=" << max_secs << ", expired_only=" << + expired_only << dendl; + rados::cls::lock::Lock l(gc_index_lock_name); utime_t end = ceph_clock_now(); @@ -288,7 +292,14 @@ int RGWGC::process(int index, int max_secs, bool expired_only, do { int max = 100; std::list entries; - ret = cls_rgw_gc_list(store->gc_pool_ctx, obj_names[index], marker, max, expired_only, entries, &truncated, next_marker); + + ret = cls_rgw_gc_list(store->gc_pool_ctx, obj_names[index], marker, max, + expired_only, entries, &truncated, next_marker); + ldpp_dout(this, 20) << + "RGWGC::process cls_rgw_gc_list returned with returned:" << ret << + ", entries.size=" << entries.size() << ", truncated=" << truncated << + ", next_marker='" << next_marker << "'" << dendl; + if (ret == -ENOENT) { ret = 0; goto done; @@ -296,10 +307,17 @@ int RGWGC::process(int index, int max_secs, bool expired_only, if (ret < 0) goto done; + marker = next_marker; + string last_pool; std::list::iterator iter; for (iter = entries.begin(); iter != entries.end(); ++iter) { cls_rgw_gc_obj_info& info = *iter; + + ldpp_dout(this, 20) << "RGWGC::process iterating over entry tag='" << + info.tag << "', time=" << info.time << ", chain.objs.size()=" << + info.chain.objs.size() << dendl; + std::list::iterator liter; cls_rgw_obj_chain& chain = info.chain;