]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PGMonitor add check only concern our self cluster command 9976/head
authorSong Baisen <song.baisen@zte.com.cn>
Wed, 22 Jun 2016 08:30:46 +0000 (16:30 +0800)
committersongbaisen <song.baisen@zte.com.cn>
Fri, 25 Nov 2016 05:55:39 +0000 (13:55 +0800)
 we only concern the command send to our self cluster

 Signed-off-by:song baisen <song.baisen@zte.com.cn>

src/mon/PGMonitor.cc

index 4ed4a0d9290108ec375ec6d44c3607865b1e0841..2021e7574e3940b42e593fa59bb83ad480ddbb9c 100644 (file)
@@ -699,6 +699,12 @@ bool PGMonitor::preprocess_pg_stats(MonOpRequestRef op)
     return true;
   }
 
+  if (stats->fsid != mon->monmap->fsid) {
+    dout(0) << __func__ << " drop message on fsid " << stats->fsid << " != "
+            << mon->monmap->fsid << " for " << *stats << dendl;
+    return true;
+  }
+
   // First, just see if they need a new osdmap. But
   // only if they've had the map for a while.
   if (stats->had_map_for > 30.0 &&
@@ -1612,6 +1618,12 @@ bool PGMonitor::preprocess_command(MonOpRequestRef op)
   stringstream ss, ds;
   bool primary = false;
 
+  if (m->fsid != mon->monmap->fsid) {
+    dout(0) << __func__ << " drop message on fsid " << m->fsid << " != "
+            << mon->monmap->fsid << " for " << *m << dendl;
+    return true;
+  }
+
   map<string, cmd_vartype> cmdmap;
   if (!cmdmap_from_json(m->cmd, &cmdmap, ss)) {
     // ss has reason for failure
@@ -1927,6 +1939,11 @@ bool PGMonitor::prepare_command(MonOpRequestRef op)
 {
   op->mark_pgmon_event(__func__);
   MMonCommand *m = static_cast<MMonCommand*>(op->get_req());
+  if (m->fsid != mon->monmap->fsid) {
+    dout(0) << __func__ << " drop message on fsid " << m->fsid << " != "
+            << mon->monmap->fsid << " for " << *m << dendl;
+    return true;
+  }
   stringstream ss;
   pg_t pgid;
   epoch_t epoch = mon->osdmon()->osdmap.get_epoch();