]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: get fsid from monmap, not osdmap
authorSage Weil <sage@newdream.net>
Thu, 29 Dec 2011 17:00:46 +0000 (09:00 -0800)
committerSage Weil <sage@newdream.net>
Thu, 29 Dec 2011 17:00:46 +0000 (09:00 -0800)
We may not have a valid OSDMap in all of these cases (notably, during
boot).  Always take the fsid from the monmap, which will be valid after
we've authenticated.

This fixes messages like

2011-12-29 08:53:44.530830 7ff3595e2700 mon.a@0(leader).pg v5 handle_statfs on fsid 00000000-0000-0000-0000-000000000000 != f8a6383d-5fbe-4f65-907e-f8d09e1d540d

on the monitor from MPGStats messages with a bad fsid right after osd boot.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/PGMonitor.cc
src/osd/OSD.cc

index d4f31f1c81821294b0386d8453160912e2a28a26..77d14185ded5883a3221da38288e170dfd86ee24 100644 (file)
@@ -427,7 +427,7 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats)
   int from = stats->get_orig_source().num();
 
   if (stats->fsid != mon->monmap->fsid) {
-    dout(0) << "handle_statfs on fsid " << stats->fsid << " != " << mon->monmap->fsid << dendl;
+    dout(0) << "prepare_pg_stats on fsid " << stats->fsid << " != " << mon->monmap->fsid << dendl;
     stats->put();
     return false;
   }
index 467816fe9ef4c5284c35225cebca762b81008d4e..f80eefc67ae40c89b1de9cb1a065eb1ef670693e 100644 (file)
@@ -1419,7 +1419,7 @@ void OSD::_add_heartbeat_source(int p, map<int, epoch_t>& old_from, map<int, uti
     dout(10) << "update_heartbeat_peers: new _from osd." << p
             << " " << con->get_peer_addr() << dendl;
     heartbeat_from_stamp[p] = ceph_clock_now(g_ceph_context);  
-    MOSDPing *m = new MOSDPing(osdmap->get_fsid(), 0, heartbeat_epoch,
+    MOSDPing *m = new MOSDPing(monc->get_fsid(), 0, heartbeat_epoch,
                               MOSDPing::START_HEARTBEAT);
     hbin_messenger->send_message(m, con);
   }
@@ -1486,14 +1486,14 @@ void OSD::update_heartbeat_peers()
       dout(10) << "update_heartbeat_peers: telling old peer osd." << p->first
               << " " << old_con[p->first]->get_peer_addr()
               << " they are down" << dendl;
-      hbin_messenger->send_message(new MOSDPing(osdmap->get_fsid(), heartbeat_epoch,
+      hbin_messenger->send_message(new MOSDPing(monc->get_fsid(), heartbeat_epoch,
                                                heartbeat_epoch,
                                                MOSDPing::YOU_DIED), con);
       hbin_messenger->mark_disposable(con);
       hbin_messenger->mark_down_on_empty(con);
     } else {
       // tell them to stop sending heartbeats
-      hbin_messenger->send_message(new MOSDPing(osdmap->get_fsid(), 0, heartbeat_epoch,
+      hbin_messenger->send_message(new MOSDPing(monc->get_fsid(), 0, heartbeat_epoch,
                                                MOSDPing::STOP_HEARTBEAT), con);
     }
     if (!osdmap->is_up(p->first)) {
@@ -1709,7 +1709,7 @@ void OSD::heartbeat()
        i++) {
     int peer = i->first;
     dout(30) << "heartbeat allocating ping for osd." << peer << dendl;
-    Message *m = new MOSDPing(osdmap->get_fsid(),
+    Message *m = new MOSDPing(monc->get_fsid(),
                              map_locked ? osdmap->get_epoch():0, 
                              i->second, MOSDPing::HEARTBEAT);
     m->set_priority(CEPH_MSG_PRIO_HIGH);
@@ -2130,7 +2130,7 @@ void OSD::send_pg_stats(const utime_t &now)
     utime_t had_for(now);
     had_for -= had_map_since;
 
-    MPGStats *m = new MPGStats(osdmap->get_fsid(), osdmap->get_epoch(), had_for);
+    MPGStats *m = new MPGStats(monc->get_fsid(), osdmap->get_epoch(), had_for);
     m->set_tid(++pg_stat_tid);
     m->osd_stat = cur_stat;