From 77d6256e318826f8caf6351aa9ffec61113eb213 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 29 Jan 2019 10:43:58 -0500 Subject: [PATCH] rgw: only update last_trim marker on ENODATA if cls_log_trim() returns 0, it may have stopped after 1000 entries before trimming all the way to to_marker. only update last_trim on ENODATA, so we continue trimming until done Fixes: http://tracker.ceph.com/issues/38075 Signed-off-by: Casey Bodley (cherry picked from commit f25e85696c40d19e02c2cdeab4148c5751966068) Conflicts: src/rgw/rgw_cr_rados.cc : Resolved for compat.h --- src/rgw/rgw_cr_rados.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 8c4b1e52930..d8f34cde83e 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -1,3 +1,4 @@ +#include "include/compat.h" #include "rgw_rados.h" #include "rgw_coroutine.h" #include "rgw_cr_rados.h" @@ -799,9 +800,10 @@ RGWSyncLogTrimCR::RGWSyncLogTrimCR(RGWRados *store, const std::string& oid, int RGWSyncLogTrimCR::request_complete() { int r = RGWRadosTimelogTrimCR::request_complete(); - if (r < 0 && r != -ENODATA) { + if (r != -ENODATA) { return r; } + // nothing left to trim, update last_trim_marker if (*last_trim_marker < to_marker) { *last_trim_marker = to_marker; } -- 2.47.3