]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: unconditionally encode PGMap full ratios in the Incremental
authorGreg Farnum <gregory.farnum@dreamhost.com>
Mon, 16 Apr 2012 18:13:45 +0000 (11:13 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 18 Apr 2012 18:05:05 +0000 (11:05 -0700)
This properly spreads the real value to peon monitors -- they weren't
seeing the right values at all before.
Initialize all related values to zero so that it's obvious if they
somehow avoided becoming set properly.
This doesn't require any kind of protocol revision, luckily -- mixing
monitors from before and after this change might result in extra work
recalculating full sets, but it won't spread bad values or anything.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mon/PGMap.cc
src/mon/PGMap.h
src/mon/PGMonitor.cc

index 107c1130fc41b6de6b459af01be9dfc78c10cba4..444d02869dbe745b1989f221825701f5c87aae35 100644 (file)
@@ -131,11 +131,11 @@ void PGMap::apply_incremental(const Incremental& inc)
   assert(inc.version == version+1);
   version++;
   bool ratios_changed = false;
-  if (inc.full_ratio != 0) {
+  if (inc.full_ratio != 0 && inc.full_ratio != full_ratio) {
     full_ratio = inc.full_ratio;
     ratios_changed = true;
   }
-  if (inc.nearfull_ratio != 0) {
+  if (inc.nearfull_ratio != 0 && inc.nearfull_ratio != nearfull_ratio) {
     nearfull_ratio = inc.nearfull_ratio;
     ratios_changed = true;
   }
index 90df77db8a826f1422b862cc61dddce9a173ee51..d6b93278576833edc2d5d0a9b82e0f201374a919 100644 (file)
@@ -82,7 +82,7 @@ public:
   PGMap()
     : version(0),
       last_osdmap_epoch(0), last_pg_scan(0),
-      full_ratio(.8), nearfull_ratio(.9),
+      full_ratio(0), nearfull_ratio(0),
       num_pg(0),
       num_osd(0)
   {}
index 56a0722f00c14830e1c6e39014f6464ad2e7f4dd..8d8a2190bbfc2a309201b31c8927b99d22f1f616 100644 (file)
@@ -307,6 +307,8 @@ void PGMonitor::create_pending()
 {
   pending_inc = PGMap::Incremental();
   pending_inc.version = pg_map.version + 1;
+  pending_inc.full_ratio = pg_map.full_ratio;
+  pending_inc.nearfull_ratio = pg_map.nearfull_ratio;
   dout(10) << "create_pending v " << pending_inc.version << dendl;
 }