]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: only fill in full/nearfull sets if the ratio > 0
authorSage Weil <sage@newdream.net>
Tue, 17 Apr 2012 17:32:38 +0000 (10:32 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 18 Apr 2012 18:05:13 +0000 (11:05 -0700)
This avoids putting all OSDs in both sets when the ratios are 0, as they
are with a fresh cluster and pgmap.  This also makes setting the ratio to
0 effectively disable the full/nearfull feature.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/PGMap.cc

index 444d02869dbe745b1989f221825701f5c87aae35..85a925079f555a871aa4fc01459c72f4a2f36c58 100644 (file)
@@ -226,9 +226,9 @@ void PGMap::redo_full_sets()
        i != osd_stat.end();
        ++i) {
     float ratio = ((float)i->second.kb_used) / ((float)i->second.kb);
-    if ( ratio > full_ratio )
+    if (full_ratio > 0 && ratio > full_ratio)
       full_osds.insert(i->first);
-    else if ( ratio > nearfull_ratio )
+    else if (nearfull_ratio > 0 && ratio > nearfull_ratio)
       nearfull_osds.insert(i->first);
   }
 }