From: Joao Eduardo Luis Date: Wed, 21 Jan 2015 17:45:02 +0000 (+0000) Subject: mon: mon_types.h: initialize LevelDBStoreStats and avoid craziness X-Git-Tag: v0.94~57^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6c2dea970392d5192f98b6d8ac7a273a4dfce65b;p=ceph.git mon: mon_types.h: initialize LevelDBStoreStats and avoid craziness 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 --- diff --git a/src/mon/mon_types.h b/src/mon/mon_types.h index c3a39979268e..f28e5e60816a 100644 --- a/src/mon/mon_types.h +++ b/src/mon/mon_types.h @@ -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);