]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: mon_types.h: initialize LevelDBStoreStats and avoid craziness
authorJoao Eduardo Luis <joao@redhat.com>
Wed, 21 Jan 2015 17:45:02 +0000 (17:45 +0000)
committerJoao Eduardo Luis <jecluis@gmail.com>
Sun, 1 Mar 2015 10:11:24 +0000 (10:11 +0000)
On a mixed-version cluster, say firefly and dumpling, the first round of
data health checks could end up with crazy values being reported for
data usage/availability for dumpling monitors.

This would be caused by dumpling not supporting reporting of store
stats, and by not assuming values as zero on decoding we would end up
decoding trash.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/mon/mon_types.h

index c3a39979268efa5b52e36417ad6ae388fe24fcde..f28e5e60816a3f704b12bc6e975e4944d1c2f59d 100644 (file)
@@ -56,6 +56,13 @@ struct LevelDBStoreStats {
   uint64_t bytes_misc;
   utime_t last_update;
 
+  LevelDBStoreStats() :
+    bytes_total(0),
+    bytes_sst(0),
+    bytes_log(0),
+    bytes_misc(0)
+  {}
+
   void dump(Formatter *f) const {
     assert(f != NULL);
     f->dump_int("bytes_total", bytes_total);