]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: update PaxosService::cached_first_committed in PaxosService::maybe_trim()
authorXuehan Xu <xuxuehan@360.cn>
Wed, 10 Jan 2018 03:17:16 +0000 (11:17 +0800)
committerXuehan Xu <xuxuehan@360.cn>
Wed, 10 Jan 2018 03:17:16 +0000 (11:17 +0800)
This should be able to avoid interleaving execution of Paxos::commit_finish() and
check_sub(), which could lead to unexpected failure of ceph-mon.

Fixes: http://tracker.ceph.com/issues/11332
Signed-off-by: Xuehan Xu <xuxuehan@360.cn>
Signed-off-by: yupeng chen <chenyupeng-it@360.cn>
src/mon/PaxosService.cc

index de732c322301956af95f9e7276495fb842f2467b..e2b9376bdc70b52e87b4aa67c03584cd18fd6421 100644 (file)
@@ -399,6 +399,7 @@ void PaxosService::maybe_trim()
   MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
   trim(t, get_first_committed(), trim_to);
   put_first_committed(t, trim_to);
+  cached_first_committed = trim_to;
 
   // let the service add any extra stuff
   encode_trim_extra(t, trim_to);