]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/DecayCounter: set last_decay to current time when decoding decay counter 22816/head
authorZhi Zhang <willzzhang@tencent.com>
Thu, 7 Jun 2018 06:18:15 +0000 (14:18 +0800)
committerPrashant D <pdhange@redhat.com>
Tue, 3 Jul 2018 08:42:17 +0000 (04:42 -0400)
The last_decay in the msg might be 0 (utime_t()), so the eclipse time is very
large and the original value would be decayed to 0. We should set last_decay
to current time when decoding decay counter.

Fixes: http://tracker.ceph.com/issues/24440
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
(cherry picked from commit 25166273764417258c9ad5bd9861d01875d25a1e)

src/common/DecayCounter.cc

index 86562b3e99a15837207efbb8af637b77dbc2da28..fb2e0764abbffe75cce896f60fbf736735af16a7 100644 (file)
@@ -38,6 +38,7 @@ void DecayCounter::decode(const utime_t &t, bufferlist::iterator &p)
   decode(val, p);
   decode(delta, p);
   decode(vel, p);
+  last_decay = t;
   DECODE_FINISH(p);
 }