From: Xuehan Xu Date: Wed, 10 Jan 2018 03:17:16 +0000 (+0800) Subject: mon: update PaxosService::cached_first_committed in PaxosService::maybe_trim() X-Git-Tag: v12.2.5~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21328%2Fhead;p=ceph.git 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 (cherry picked from commit c3c88d84d696016d56a04f95662dc1f4f937ebec) --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index de732c322301..e2b9376bdc70 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);