]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_log: always return final marker from log_list
authorJosh Durgin <josh.durgin@inktank.com>
Thu, 24 Oct 2013 15:18:19 +0000 (08:18 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Thu, 24 Oct 2013 15:56:07 +0000 (08:56 -0700)
There's no reason to restrict returning the marker to the case where
less than the whole log is returned, since there's already a truncated
flag to tell the client what happened.

Giving the client the last marker makes it easy to consume when the
log entries do not contain their own marker. If the last marker is not
returned, the client cannot get the last marker without racing with
updates to the log.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/cls/log/cls_log.cc

index 46ba357480c5dc73a65745044b108ac5d689f0bf..7b254fdbea5487523d15aeee7c4b14d9ac203e99 100644 (file)
@@ -211,9 +211,8 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   if (iter == keys.end())
     done = true;
-  else
-    ret.marker = marker;
 
+  ret.marker = marker;
   ret.truncated = !done;
 
   ::encode(ret, *out);