From bec7bd0d96040bf30954eed07bdf2178f8ff4d17 Mon Sep 17 00:00:00 2001 From: Deepika Upadhyay Date: Wed, 23 Jun 2021 10:42:38 +0530 Subject: [PATCH] mon/PGMap: DIRTY field as N/A in `df detail` when cache tier not in use 'ceph df detail' reports a column for DIRTY objects under POOLS even though cache tiers not being used. In replicated or EC pool all objects in the pool are reported as logically DIRTY as they have never been flushed . we display N/A for DIRTY objects if the pool is not a cache tier. Signed-off-by: Deepika Upadhyay (cherry picked from commit fafebb1824eb474dbbeb4137c033954d45b508af) --- src/mon/PGMap.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 55f72d354760..fddee3097676 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -954,7 +954,11 @@ void PGMapDigest::dump_object_stat_sum( if (verbose) { f->dump_int("quota_objects", pool->quota_max_objects); f->dump_int("quota_bytes", pool->quota_max_bytes); - f->dump_int("dirty", sum.num_objects_dirty); + if (pool->is_tier()) { + f->dump_int("dirty", sum.num_objects_dirty); + } else { + f->dump_int("dirty", 0); + } f->dump_int("rd", sum.num_rd); f->dump_int("rd_bytes", sum.num_rd_kb * 1024ull); f->dump_int("wr", sum.num_wr); @@ -984,16 +988,17 @@ void PGMapDigest::dump_object_stat_sum( tbl << "N/A"; else tbl << stringify(si_u_t(pool->quota_max_objects)); - if (pool->quota_max_bytes == 0) tbl << "N/A"; else tbl << stringify(byte_u_t(pool->quota_max_bytes)); - - tbl << stringify(si_u_t(sum.num_objects_dirty)) - << stringify(byte_u_t(statfs.data_compressed_allocated)) - << stringify(byte_u_t(statfs.data_compressed_original)) - ; + if (pool->is_tier()) { + tbl << stringify(si_u_t(sum.num_objects_dirty)); + } else { + tbl << "N/A"; + } + tbl << stringify(byte_u_t(statfs.data_compressed_allocated)); + tbl << stringify(byte_u_t(statfs.data_compressed_original)); } } } -- 2.47.3