]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: DIRTY field as N/A in `df detail` when cache tier not in use
authorDeepika Upadhyay <dupadhya@redhat.com>
Wed, 23 Jun 2021 05:12:38 +0000 (10:42 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Tue, 27 Jul 2021 01:36:20 +0000 (07:06 +0530)
    '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 <dupadhya@redhat.com>
src/mon/PGMap.cc

index 47dd37ea5078db8ba24a1fc1cd2a38d8556ccc40..cde8f0dd0cd60deaf30fa7648c57930b03d5609a 100644 (file)
@@ -925,7 +925,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);
@@ -955,16 +959,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));
     }
   }
 }