Skip to content

Commit

Permalink
Merge pull request ceph#10121 from theanalyst/wip-16357
Browse files Browse the repository at this point in the history
rgw: cls_user don't clobber existing bucket stats when creating bucket
Reviewed-by: Orit Wasserman <[email protected]>
  • Loading branch information
oritwas committed Mar 26, 2017
2 parents 2e97d18 + 06955d6 commit 9de1f1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cls/user/cls_user.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,13 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in,
CLS_LOG(20, "storing entry for key=%s size=%lld count=%lld",
key.c_str(), (long long)update_entry.size, (long long)update_entry.count);

apply_entry_stats(update_entry, &entry);
// sync entry stats when not an op.add, as when the case is op.add if its a
// new entry we already have copied update_entry earlier, OTOH, for an existing entry
// we end up clobbering the existing stats for the bucket
if (!op.add){
apply_entry_stats(update_entry, &entry);
}

entry.user_stats_sync = true;

ret = write_entry(hctx, key, entry);
Expand Down

0 comments on commit 9de1f1a

Please sign in to comment.