From: Sage Weil Date: Wed, 26 Jun 2013 13:52:01 +0000 (-0700) Subject: mon/PaxosService: add post_paxos_update() hook X-Git-Tag: v0.67-rc1~175^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=131686980f0a930d5de7cbce8234fead5bd438b6;p=ceph.git mon/PaxosService: add post_paxos_update() hook Some services need to update internal state based on other service's state, and thus need to be run after everyone has pulled their info out of paxos. Backport: cuttlefish Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 4e428a88144..42bf9d5ac0b 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -537,6 +537,9 @@ void Monitor::refresh_from_paxos(bool *need_bootstrap) for (int i = 0; i < PAXOS_NUM; ++i) { paxos_service[i]->refresh(need_bootstrap); } + for (int i = 0; i < PAXOS_NUM; ++i) { + paxos_service[i]->post_paxos_update(); + } } void Monitor::register_cluster_logger() diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 8cd8908556b..4981c34be47 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -347,6 +347,14 @@ public: */ virtual void update_from_paxos(bool *need_bootstrap) = 0; + /** + * Hook called after all services have refreshed their state from paxos + * + * This is useful for doing any update work that depends on other + * service's having up-to-date state. + */ + virtual void post_paxos_update() {} + /** * Init on startup *