From 924b1fcbf73724453ed928549011ac63f82f7609 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Nov 2010 09:49:43 -0800 Subject: [PATCH] osd: bind to new cluster address when wrongly marked down If we come back up on the same address, there is a possible race. Other nodes will mark_down when they see us go down. If we go up first, queue some messages, and _then_ they see that we're down and mark_down, the messages we queued will get lost. Since it's stateful on the cluster backend, we need to introduce an ordering so that closing out the _old_ session doesn't break the new session. We do this by binding to a new address (just a different port, actually) before marking ourselves back up. Fixes #592. Signed-off-by: Sage Weil --- src/osd/OSD.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 98c9d337d4dc6..4e442555715f7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2717,6 +2717,10 @@ void OSD::handle_osd_map(MOSDMap *m) state = STATE_BOOTING; up_epoch = 0; + int r = cluster_messenger->rebind(); + if (r != 0) + do_shutdown = true; // FIXME: do_restart? + reset_heartbeat_peers(); } } -- 2.39.5