]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: nonexists object shoud not be accounted when check_index 47078/head
authorHuber-ming <zhangsm01@inspur.com>
Wed, 13 Jul 2022 05:47:43 +0000 (13:47 +0800)
committerHuber-ming <zhangsm01@inspur.com>
Wed, 13 Jul 2022 05:47:43 +0000 (13:47 +0800)
Signed-off-by: Huber-ming <zhangsm01@inspur.com>
src/cls/rgw/cls_rgw.cc

index e440b73ecec25e1a86cb30020d656086d9382faa..25fe3b27576abc2b7dbe05bbc23e88360af1af70 100644 (file)
@@ -718,12 +718,14 @@ static int check_index(cls_method_context_t hctx,
         CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s", kiter->first.c_str());
         return -EIO;
       }
-      rgw_bucket_category_stats& stats = calc_header->stats[entry.meta.category];
-      stats.num_entries++;
-      stats.total_size += entry.meta.accounted_size;
-      stats.total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size);
-      stats.actual_size += entry.meta.size;
-
+      if (entry.exists) {
+        rgw_bucket_category_stats& stats = calc_header->stats[entry.meta.category];
+        stats.num_entries++;
+        stats.total_size += entry.meta.accounted_size;
+        stats.total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size);
+        stats.actual_size += entry.meta.size;
+      }
+      
       start_obj = kiter->first;
     }
   } while (keys.size() == CHECK_CHUNK_SIZE && !done);