From c3c88d84d696016d56a04f95662dc1f4f937ebec Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Wed, 10 Jan 2018 11:17:16 +0800 Subject: [PATCH] mon: update PaxosService::cached_first_committed in PaxosService::maybe_trim() 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 Signed-off-by: yupeng chen --- src/mon/PaxosService.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index de732c32230..e2b9376bdc7 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -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); -- 2.39.5