diff options
-rw-r--r-- | src/common/config_opts.h | 2 | ||||
-rw-r--r-- | src/mon/Monitor.cc | 21 | ||||
-rw-r--r-- | src/mon/Monitor.h | 10 | ||||
-rw-r--r-- | src/mon/Paxos.cc | 8 |
4 files changed, 23 insertions, 18 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 3b9d025393f..1c7a917602a 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -80,7 +80,7 @@ SUBSYS(journal, 1, 3) SUBSYS(ms, 0, 5) SUBSYS(mon, 1, 5) SUBSYS(monc, 0, 10) -SUBSYS(paxos, 0, 5) +SUBSYS(paxos, 1, 5) SUBSYS(tp, 0, 5) SUBSYS(auth, 1, 5) SUBSYS(crypto, 1, 5) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 92e6fa4ca76..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; @@ -923,8 +927,6 @@ void Monitor::sync_finish(version_t last_committed) t.erase("mon_sync", "last_committed_floor"); store->apply_transaction(t); - sync_reset(); - assert(g_conf->mon_sync_requester_kill_at != 9); init_paxos(); @@ -1173,7 +1175,6 @@ void Monitor::handle_sync_chunk(MMonSync *m) void Monitor::handle_sync_no_cookie(MMonSync *m) { dout(10) << __func__ << dendl; - sync_reset(); bootstrap(); } diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 0337998cd6e..69dfefe144a 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -302,10 +302,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) diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index a543abed7ed..445413da13b 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -492,7 +492,7 @@ void Paxos::handle_last(MMonPaxos *last) void Paxos::collect_timeout() { - dout(5) << "collect timeout, calling fresh election" << dendl; + dout(1) << "collect timeout, calling fresh election" << dendl; collect_timeout_event = 0; assert(mon->is_leader()); mon->bootstrap(); @@ -711,7 +711,7 @@ void Paxos::handle_accept(MMonPaxos *accept) void Paxos::accept_timeout() { - dout(5) << "accept timeout, calling fresh election" << dendl; + dout(1) << "accept timeout, calling fresh election" << dendl; accept_timeout_event = 0; assert(mon->is_leader()); assert(is_updating() || is_updating_previous()); @@ -1004,7 +1004,7 @@ void Paxos::handle_lease_ack(MMonPaxos *ack) void Paxos::lease_ack_timeout() { - dout(5) << "lease_ack_timeout -- calling new election" << dendl; + dout(1) << "lease_ack_timeout -- calling new election" << dendl; assert(mon->is_leader()); assert(is_active()); @@ -1023,7 +1023,7 @@ void Paxos::reset_lease_timeout() void Paxos::lease_timeout() { - dout(5) << "lease_timeout -- calling new election" << dendl; + dout(1) << "lease_timeout -- calling new election" << dendl; assert(mon->is_peon()); lease_timeout_event = 0; |