Merge pull request #9976 from songbaisen/a13

mon: PGMonitor add check only concern our self cluster command

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-02-07 17:14:14 -06:00 committed by GitHub
commit eafbe4486e

View File

@ -651,6 +651,12 @@ bool PGMonitor::preprocess_pg_stats(MonOpRequestRef op)
return true;
}
if (stats->fsid != mon->monmap->fsid) {
dout(0) << __func__ << " drop message on fsid " << stats->fsid << " != "
<< mon->monmap->fsid << " for " << *stats << dendl;
return true;
}
// First, just see if they need a new osdmap. But
// only if they've had the map for a while.
if (stats->had_map_for > 30.0 &&
@ -1028,6 +1034,12 @@ bool PGMonitor::preprocess_command(MonOpRequestRef op)
stringstream ss, ds;
bool primary = false;
if (m->fsid != mon->monmap->fsid) {
dout(0) << __func__ << " drop message on fsid " << m->fsid << " != "
<< mon->monmap->fsid << " for " << *m << dendl;
return true;
}
map<string, cmd_vartype> cmdmap;
if (!cmdmap_from_json(m->cmd, &cmdmap, ss)) {
// ss has reason for failure
@ -1351,6 +1363,11 @@ bool PGMonitor::prepare_command(MonOpRequestRef op)
{
op->mark_pgmon_event(__func__);
MMonCommand *m = static_cast<MMonCommand*>(op->get_req());
if (m->fsid != mon->monmap->fsid) {
dout(0) << __func__ << " drop message on fsid " << m->fsid << " != "
<< mon->monmap->fsid << " for " << *m << dendl;
return true;
}
stringstream ss;
pg_t pgid;
epoch_t epoch = mon->osdmon()->osdmap.get_epoch();