Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hammer: mon: drop pg temps from not the current primary in OSDMonitor #9893

Merged
merged 1 commit into from Jul 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/mon/OSDMonitor.cc
Expand Up @@ -2028,6 +2028,21 @@ bool OSDMonitor::preprocess_pgtemp(MOSDPGTemp *m)
continue;
}

int acting_primary = -1;
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