]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: only update last_trim marker on ENODATA 26190/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 29 Jan 2019 15:43:58 +0000 (10:43 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 29 Jan 2019 17:26:23 +0000 (12:26 -0500)
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 <cbodley@redhat.com>
src/rgw/rgw_cr_rados.cc

index 6f12ca8595822665ce1cbd23ff89d50e18dde47d..09e4890b5a70696df63bcced4d43382ce89f57fe 100644 (file)
@@ -1,6 +1,7 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
+#include "include/compat.h"
 #include "rgw_rados.h"
 #include "rgw_zone.h"
 #include "rgw_coroutine.h"
@@ -819,9 +820,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;
   }