From 3a7bb9999b49641ee28cac91e493aa4c231ede54 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 10 Feb 2012 09:16:58 -0800 Subject: [PATCH] mon: initialize paxos state in constructor These should all be initialized in init() anyway (except accepted_pn_from, which is set in collect and handle_collect), but initializing them to safe defaults in the constructor provides a safety net. Signed-off-by: Greg Farnum --- src/mon/Paxos.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index e67a975f4fa6a..94b58e88c8b02 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -105,7 +105,6 @@ public: private: // recovery (phase 1) - version_t first_committed_any; version_t first_committed; version_t last_pn; version_t last_committed; @@ -237,6 +236,11 @@ public: machine_id(mid), machine_name(get_paxos_name(mid)), state(STATE_RECOVERING), + first_committed(0), + last_pn(0), + last_committed(0), + accepted_pn(0), + accepted_pn_from(0), collect_timeout_event(0), lease_renew_event(0), lease_ack_timeout_event(0), -- 2.39.5