]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: drop pg temp from sources other than the current primary 9875/head
authorSamuel Just <sjust@redhat.com>
Thu, 2 Jun 2016 17:43:17 +0000 (10:43 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 2 Jun 2016 17:43:17 +0000 (10:43 -0700)
Fixes: http://tracker.ceph.com/issues/16127
Signed-off-by: Samuel Just <sjust@redhat.com>
src/mon/OSDMonitor.cc

index c18583cb65d30cb5b121bf51dfa0df7b68a4dcc0..85d0aca1c193e5258c5b365c3a8837f4eaa70d4a 100644 (file)
@@ -2328,6 +2328,21 @@ bool OSDMonitor::preprocess_pgtemp(MonOpRequestRef op)
       continue;
     }
 
+    int acting_primary = -1;
+    osdmap.pg_to_up_acting_osds(
+      p->first, nullptr, nullptr, nullptr, &acting_primary);
+    if (acting_primary != from) {
+      /* If the source isn't the primary based on the current osdmap, we know
+       * that the interval changed and that we can discard this message.
+       * Indeed, we must do so to avoid 16127 since we can't otherwise determine
+       * which of two pg temp mappings on the same pg is more recent.
+       */
+      dout(10) << __func__ << " ignore " << p->first << " -> " << p->second
+              << ": primary has changed" << dendl;
+      ignore_cnt++;
+      continue;
+    }
+
     // removal?
     if (p->second.empty() && (osdmap.pg_temp->count(p->first) ||
                              osdmap.primary_temp->count(p->first)))