]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: initialize paxos state in constructor
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Feb 2012 17:16:58 +0000 (09:16 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Feb 2012 17:16:58 +0000 (09:16 -0800)
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 <gregory.farnum@dreamhost.com>
src/mon/Paxos.h

index e67a975f4fa6a25015824f17ff13017b810d7f11..94b58e88c8b0258fc46c33b03220e1d086964346 100644 (file)
@@ -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),