]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: drop pg temp from sources other than the current primary 9998/head
authorSamuel Just <sjust@redhat.com>
Thu, 2 Jun 2016 17:43:17 +0000 (10:43 -0700)
committerLoic Dachary <ldachary@redhat.com>
Wed, 29 Jun 2016 08:24:56 +0000 (10:24 +0200)
Fixes: http://tracker.ceph.com/issues/16127
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 1a07123c38e3fecb3fb2e43bbbae962d8411d287)

src/mon/OSDMonitor.cc

index 68bcc97639ebea3eeb918af5f566bbb50402dce9..a6e323735938d34334a5aadcef1e180ce905eef5 100644 (file)
@@ -2310,6 +2310,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)))