New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: cls_user don't clobber existing bucket stats when creating bucket #10121

Merged
merged 1 commit into from Mar 26, 2017

Conversation

Projects
None yet
2 participants
@theanalyst
Member

theanalyst commented Jul 4, 2016

when cls_user_set_buckets_info is called by create bucket, we sync the
entry stats from the given info and thus end up setting the existing
stats on a bucket to 0, this is later corrected during a bucket sync,
however there is no need to update the entry and override the existing
bucket count and stats (as these aren't set during the call) and if it
is a new bucket call we already copy over the values earlier.

Fixes: http://tracker.ceph.com/issues/16357

Reported-by: pengju jiao pj.jiao@139.com
Signed-off-by: Abhishek Lekshmanan abhishek@suse.com

rgw: cls_user sync entry stats when not a add op
when cls_user_set_buckets_info is called by create bucket, we sync the
entry stats from the given info and thus end up setting the existing
stats on a bucket to 0, this is later corrected during a bucket sync,
however there is no need to update the entry and override the existing
bucket count and stats (as these aren't set during the call) and if it
is a new bucket call we already copy over the values earlier.

Fixes: http://tracker.ceph.com/issues/16357

Reported-by: pengju jiao <pj.jiao@139.com>
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
@theanalyst

This comment has been minimized.

Member

theanalyst commented Jul 25, 2016

jenkins retest this please

@theanalyst

This comment has been minimized.

Member

theanalyst commented Jul 27, 2016

@oritwas can you take a look at this

@oritwas

This comment has been minimized.

Contributor

oritwas commented Jul 27, 2016

master seems fixed I cannot reproduce this behavior

@theanalyst

This comment has been minimized.

Member

theanalyst commented Jul 27, 2016

I'm still seeing this on latest master, ie.
create bucket, upload object, do rgw stats --uid= --sync-stats ; later calls of rgw stats (w/o sync stats will show same stats) you'll see the update stats,
create same bucket again, if you do rgw stats --uid=user-d (without sync) we'll see that the stats are zeroed

@theanalyst

This comment has been minimized.

Member

theanalyst commented Aug 11, 2016

@oritwas can you see if you can still reproduce the issue in the master?

@oritwas oritwas self-assigned this Aug 17, 2016

@theanalyst

This comment has been minimized.

Member

theanalyst commented Nov 23, 2016

@oritwas can you take a look at this again, in the current master the issue still seems to exist for me,

$ s3 create bucket
$ radosgw-admin user stats --uid=testid 
{
    "stats": {
        "total_entries": 0,
        "total_bytes": 0,
        "total_bytes_rounded": 0
    },
    "last_stats_sync": "0.000000",
    "last_stats_update": "2016-11-23 14:44:50.317889Z"
}

$ s3 put bucket/file1 filename=file1
$ radosgw-admin user stats --uid=testid # still the same 0 stats
$ radosgw-admin user stats --uid=testid --sync-stats
{
    "stats": {
        "total_entries": 1,
        "total_bytes": 5582,
        "total_bytes_rounded": 8192
    },
    "last_stats_sync": "2016-11-23 14:46:29.269714Z",
    "last_stats_update": "2016-11-23 14:46:29.256246Z"
}

# Now create the same bucket again, stats will be zeroed
$ s3 create bucket
$ radosgw-admin user stats --uid=testid 
{
    "stats": {
        "total_entries": 0,
        "total_bytes": 0,
        "total_bytes_rounded": 0
    },
    "last_stats_sync": "2016-11-23 14:46:29.269714Z",
    "last_stats_update": "2016-11-23 14:46:39.278300Z"
}

With the patch the stats do not zero for the bucket anymore no longer needing an additional sync stats call

@theanalyst theanalyst requested a review from oritwas Jan 17, 2017

@theanalyst

This comment has been minimized.

Member

theanalyst commented Mar 22, 2017

@oritwas ping

@oritwas oritwas merged commit 9de1f1a into ceph:master Mar 26, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment