Skip to content

Commit

Permalink
OSDMonitor: drop pg temp from sources other than the current primary
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/16127
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 1a07123)

	change:
            use NULL to replace the nullptr because we don't have C++11
  • Loading branch information
athanatos authored and Vicente-Cheng committed Jul 18, 2016
1 parent 2e156d7 commit 0960f21
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/mon/OSDMonitor.cc
Expand Up @@ -2028,6 +2028,20 @@ bool OSDMonitor::preprocess_pgtemp(MOSDPGTemp *m)
continue;
}

osdmap.pg_to_up_acting_osds(
p->first, NULL, NULL, NULL, &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)))
Expand Down

0 comments on commit 0960f21

Please sign in to comment.