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>
  • Loading branch information
athanatos committed Jun 2, 2016
1 parent b55b6fb commit 1a07123
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/mon/OSDMonitor.cc
Expand Up @@ -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)))
Expand Down

0 comments on commit 1a07123

Please sign in to comment.