From 979722509fbe9b327c82642c6ce9f2d106a6f6e9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 4 Dec 2008 13:46:19 -0800 Subject: [PATCH] mon: keep pgmap consistent We were cutting corners and updating the live map before it committed to paxos, since pg stats aren't system critical. This can lead to problems due to the way "latest" is saved out, though, and it can be confusing to see things jump backward in time. --- src/mon/PGMonitor.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index c8d704887d720..1fd102c3b2f6c 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -322,15 +322,22 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats) // osd stat pending_inc.osd_stat_updates[from] = stats->osd_stat; - // apply to live map too (screw consistency) - if (pg_map.osd_stat.count(from)) { + if (pg_map.osd_stat.count(from)) dout(10) << " got osd" << from << " " << stats->osd_stat << " (was " << pg_map.osd_stat[from] << ")" << dendl; - pg_map.stat_osd_sub(pg_map.osd_stat[from]); - } else { + else dout(10) << " got osd " << from << " " << stats->osd_stat << " (first report)" << dendl; - } + + // apply to live map too (screw consistency) + /* + actually, no, don't. that screws up our "latest" stash. and can + lead to weird output where things appear to jump backwards in + time... that's just confusing. + + if (pg_map.osd_stat.count(from)) + pg_map.stat_osd_sub(pg_map.osd_stat[from]); pg_map.osd_stat[from] = stats->osd_stat; pg_map.stat_osd_add(stats->osd_stat); + */ // pg stats MPGStatsAck *ack = new MPGStatsAck; @@ -367,10 +374,12 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats) << dendl; pending_inc.pg_stat_updates[pgid] = p->second; + /* // we don't care much about consistency, here; apply to live map. pg_map.stat_pg_sub(pgid, pg_map.pg_stat[pgid]); pg_map.pg_stat[pgid] = p->second; pg_map.stat_pg_add(pgid, pg_map.pg_stat[pgid]); + */ } paxos->wait_for_commit(new C_Stats(this, ack, stats->get_orig_source_inst())); -- 2.39.5