]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: upper bound watch_check result 9104/head
authorSage Weil <sage@redhat.com>
Fri, 6 May 2016 13:09:43 +0000 (09:09 -0400)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Wed, 8 Jun 2016 09:37:12 +0000 (15:07 +0530)
This way we always return a safe upper bound on the amount of time
since we did a check.  Among other things, this prevents us from
returning a value of 0, which is confusing.

Fixes: http://tracker.ceph.com/issues/15760
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 2e2ce365866a7569b55aff338a82c132aa927089)

src/osdc/Objecter.cc

index c1f4e91c130e5abe171784856a4a623ccce71f10..2f028cf3e73d5bc9cae9750586f9cf382131d6c6 100644 (file)
@@ -706,7 +706,9 @@ int Objecter::linger_check(LingerOp *info)
                 << " age " << age << dendl;
   if (info->last_error)
     return info->last_error;
-  return std::chrono::duration_cast<std::chrono::milliseconds>(age).count();
+  // return a safe upper bound (we are truncating to ms)
+  return
+    1 + std::chrono::duration_cast<std::chrono::milliseconds>(age).count();
 }
 
 void Objecter::linger_cancel(LingerOp *info)