]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remember source client address in routed requests
authorHenry C Chang <henry_c_chang@tcloudcomputing.com>
Thu, 11 Nov 2010 03:40:39 +0000 (11:40 +0800)
committerSage Weil <sage@newdream.net>
Fri, 23 Sep 2011 19:55:55 +0000 (12:55 -0700)
when we resend_routed_requests, the source client address is lost.
This may cause problems. For example, if we resend an mds beacon
(boot) to a new monitor leader, the new mdsmap will contain a new
mds entry without IP address.

To reproduce this bug:
1. deploy a cluster with 3 mons.
2. let active mds send beacon to mon0; standby mds send becaon to mon2
3. gdb attach to mon2 to make it unresponsive and make standby mds laggy.
4. gdb attach to mon0 to make it unresponsive and make active mds laggy.
5. detach mon2, then the standby mds will become active.
6. ceph mds dump -o - shows the active mds address is :/0

Signed-off-by: Henry C Chang <henry_c_chang@tcloudcomputing.com>
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/Monitor.cc
src/mon/Monitor.h

index 6388cda0961dc86943082a8020171d7747cb41d0..5386571fe62425a8b298f646e29632ce9da257a0 100644 (file)
@@ -488,6 +488,7 @@ void Monitor::forward_request_leader(PaxosServiceMessage *req)
   } else if (session && !session->closed) {
     RoutedRequest *rr = new RoutedRequest;
     rr->tid = ++routed_request_tid;
+    rr->client = req->get_source_inst();
     encode_message(g_ceph_context, req, rr->request_bl);
     rr->session = (MonSession *)session->get();
     routed_requests[rr->tid] = rr;
@@ -634,6 +635,7 @@ void Monitor::resend_routed_requests()
 
     dout(10) << " resend to mon" << mon << " tid " << rr->tid << " " << *req << dendl;
     MForward *forward = new MForward(rr->tid, req, rr->session->caps);
+    forward->client = rr->client;
     forward->set_priority(req->get_priority());
     messenger->send_message(forward, monmap->get_inst(mon));
   }  
index 4832ea7b13b1fae07b7579e33d916733f8bfe3f5..0883ff42be180ce67162f7ab23eec554c47e08cd 100644 (file)
@@ -161,6 +161,7 @@ public:
   // request routing
   struct RoutedRequest {
     uint64_t tid;
+    entity_inst_t client;
     bufferlist request_bl;
     MonSession *session;