]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: copy actual stats from the source shards during reshard 24444/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 5 Oct 2018 09:19:18 +0000 (11:19 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 5 Oct 2018 09:24:26 +0000 (11:24 +0200)
Currently we don't copy the actual_stats field during reshard, which makes
resharded buckets show a size_utilized as 0, which further has the problem that
a subsequent object removal would subtract the object size from the 0 size
utilized showing up large uint64_t values. Copy the size_actual from the source
object in both cls and in reshard_process. This will fix the new buckets,
existing buckets will still have to go through a bucket check --fix for their
stats to be corrected.

Fixes: http://tracker.ceph.com/issues/36290
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.cc
src/rgw/rgw_reshard.cc

index 0b3563d83ac81e7bc2cbd43852adbc0c86bf33bc..9d4620496293a788923acae7e0ab7119f8554295 100644 (file)
@@ -597,6 +597,7 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis
       dest.total_size += s.second.total_size;
       dest.total_size_rounded += s.second.total_size_rounded;
       dest.num_entries += s.second.num_entries;
+      dest.actual_size += s.second.actual_size;
     }
   }
 
index 9bec682bcce97f7e0c87eb31b8802ba0926d20e4..432e6a882b66649d396591e773a96ba56cb65bd9 100644 (file)
@@ -256,6 +256,7 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc
         accounted_stats->num_entries++;
         accounted_stats->total_size += entry.meta.accounted_size;
         accounted_stats->total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size);
+        accounted_stats->actual_size += entry.meta.size;
         account = true;
       }
       break;
index cde521ff7dc47cdbce8206afe208dff8a3c044eb..c95ab7e4728b251535665b2d3c8dde0fa406c0c7 100644 (file)
@@ -83,6 +83,7 @@ public:
       target.num_entries += entry_stats.num_entries;
       target.total_size += entry_stats.total_size;
       target.total_size_rounded += entry_stats.total_size_rounded;
+      target.actual_size += entry_stats.actual_size;
     }
     if (entries.size() >= RESHARD_SHARD_WINDOW) {
       int ret = flush();