]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: copy actual stats from the source shards during reshard 24527/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 5 Oct 2018 09:19:18 +0000 (11:19 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 10 Oct 2018 16:58:57 +0000 (18:58 +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>
(cherry picked from commit beb90638ae3d5329653b61bae0d6714796c41d04)

src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.cc
src/rgw/rgw_reshard.cc

index aa415ce27596b680f8a2e512a5bc338c188f06d8..13b3e92dc9598d80de7fd0f084990eebd7c4fe7a 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 0d7b5d2181115bf0e574b662f74d5df089bc2f8e..adfc1aa79874e42c99d2e00ab72b7ff6aafd34d1 100644 (file)
@@ -253,6 +253,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 4fe60b7ba3b9f923abb35a6089a8d1985f8fc0ad..7b311116338d1f0bdf6cdc5a477922c40b2a1bbe 100644 (file)
@@ -84,6 +84,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();