diff options
-rw-r--r-- | src/mon/Monitor.cc | 18 | ||||
-rw-r--r-- | src/mon/Monitor.h | 10 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 3b19b514054..2c21e6eac69 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -619,7 +619,7 @@ void Monitor::bootstrap() { dout(10) << "bootstrap" << dendl; - sync_reset(); + sync_reset_requester(); unregister_cluster_logger(); cancel_probe_timeout(); @@ -806,23 +806,27 @@ void Monitor::sync_obtain_latest_monmap(bufferlist &bl) latest_monmap.encode(bl, CEPH_FEATURES_ALL); } -void Monitor::sync_reset() +void Monitor::sync_reset_requester() { + dout(10) << __func__ << dendl; + if (sync_timeout_event) { timer.cancel_event(sync_timeout_event); sync_timeout_event = NULL; } - // leader state - sync_providers.clear(); - - // requester state sync_provider = entity_inst_t(); sync_cookie = 0; sync_full = false; sync_start_version = 0; } +void Monitor::sync_reset_provider() +{ + dout(10) << __func__ << dendl; + sync_providers.clear(); +} + void Monitor::sync_start(entity_inst_t &other, bool full) { dout(10) << __func__ << " " << other << (full ? " full" : " recent") << dendl; @@ -832,7 +836,7 @@ void Monitor::sync_start(entity_inst_t &other, bool full) state = STATE_SYNCHRONIZING; // make sure are not a provider for anyone! - sync_reset(); + sync_reset_provider(); sync_full = full; diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index bed48ecee34..35975e7a90f 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -301,10 +301,14 @@ private: set<string> get_sync_targets_names(); /** - * Reset the monitor's sync-related data structures and state, both - * for the requester- and provider-side. + * Reset the monitor's sync-related data structures for syncing *from* a peer */ - void sync_reset(); + void sync_reset_requester(); + + /** + * Reset sync state related to allowing others to sync from us + */ + void sync_reset_provider(); /** * Caled when a sync attempt times out (requester-side) |