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: Added code to correctly account for bytes sent/ received during a 'PUT' operation. #14042

Merged
merged 1 commit into from Apr 4, 2017

Conversation

Projects
None yet
6 participants
@pritha-srivastava
Contributor

pritha-srivastava commented Mar 20, 2017

Currently, the bytes sent/ received are both set to zero after
an object is uploaded to a bucket. Added code to correct the logic.

Signed-off-by: Pritha Srivastava prsrivas@redhat.com

rgw: Added code to correctly account for bytes sent/ received during …
…a 'PUT' operation.

Currently, the bytes sent/ received are both set to zero after
an object is uploaded to a bucket. Added code to correct the logic.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
@pritha-srivastava

This comment has been minimized.

Contributor

pritha-srivastava commented Mar 20, 2017

On master, once a bucket is created and a file is uploaded to the bucket, then running radosgw-admin usage show --uid=test, shows both bytes/ sent received set to zero, whereas a download of the same file, shows the correct number of bytes sent.

swift -A http://localhost:80/auth/1.0 -U test:tester -K testing upload container1 out1.txt
sudo ./bin/radosgw-admin usage show --uid=test
{
"bucket": "container1",
"time": "2017-03-20 05:30:00.000000Z",
"epoch": 1489987800,
"owner": "test",
"categories": [
{
"category": "create_bucket",
"bytes_sent": 0,
"bytes_received": 0,
"ops": 2,
"successful_ops": 2
},
{
"category": "put_obj",
"bytes_sent": 0,
"bytes_received": 0,
"ops": 1,
"successful_ops": 1
}
]
}
swift -A http://localhost:80/auth/1.0 -U test:tester -K testing download container1 out1.txt
sudo ./bin/radosgw-admin usage show --uid=test
{
"bucket": "container1",
"time": "2017-03-20 05:30:00.000000Z",
"epoch": 1489987800,
"owner": "test",
"categories": [
{
"category": "create_bucket",
"bytes_sent": 0,
"bytes_received": 0,
"ops": 2,
"successful_ops": 2
},
{
"category": "get_obj",
"bytes_sent": 10485760,
"bytes_received": 0,
"ops": 1,
"successful_ops": 1
},
{
"category": "put_obj",
"bytes_sent": 0,
"bytes_received": 0,
"ops": 1,
"successful_ops": 1
}
]
}

After putting in the fix, the bytes-received after a 'PUT' operation, is set correctly.
swift -A http://localhost:80/auth/1.0 -U test:tester -K testing upload container1 out1.txt
sudo ./bin/radosgw-admin usage show --uid=test
{
"bucket": "container1",
"time": "2017-03-20 05:30:00.000000Z",
"epoch": 1489987800,
"owner": "test",
"categories": [
{
"category": "create_bucket",
"bytes_sent": 0,
"bytes_received": 0,
"ops": 2,
"successful_ops": 2
},
{
"category": "put_obj",
"bytes_sent": 0,
"bytes_received": 10485760,
"ops": 1,
"successful_ops": 1
}
]
}
swift -A http://localhost:80/auth/1.0 -U test:tester -K testing download container1 out1.txt
sudo ./bin/radosgw-admin usage show --uid=test
{
"bucket": "container1",
"time": "2017-03-20 05:30:00.000000Z",
"epoch": 1489987800,
"owner": "test",
"categories": [
{
"category": "create_bucket",
"bytes_sent": 0,
"bytes_received": 0,
"ops": 3,
"successful_ops": 3
},
{
"category": "get_obj",
"bytes_sent": 10485760,
"bytes_received": 0,
"ops": 1,
"successful_ops": 1
},
{
"category": "put_obj",
"bytes_sent": 0,
"bytes_received": 10485760,
"ops": 1,
"successful_ops": 1
}
]
}

@joscollin

The fix looks good to me.

@cbodley

This comment has been minimized.

Contributor

cbodley commented Mar 22, 2017

@rzarzynski can you please review? is this how you envisioned the AccountingFilter working for reads?

@cbodley cbodley requested a review from rzarzynski Mar 22, 2017

@rzarzynski

@cbodley: yeah, this looks good.

@cbodley

This comment has been minimized.

@cbodley cbodley merged commit b4c0fc7 into ceph:master Apr 4, 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
@rossmartyn04

This comment has been minimized.

rossmartyn04 commented Jun 8, 2017

Also seeing this issue, any chance of it being back-ported to Kraken?

Great news its fixed though!

@cbodley

This comment has been minimized.

Contributor

cbodley commented Jun 8, 2017

@rossmartyn04 added backport ticket http://tracker.ceph.com/issues/20225, thanks for pointing that out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment