Skip to content
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: Multipart upload may double the quota #17959

Merged
merged 1 commit into from Oct 4, 2017

Conversation

gaosibei
Copy link

@gaosibei gaosibei commented Sep 26, 2017

When user upload object using multipart api, they may upload failed. The reason is that the object size is added twice to quota stats.

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

Signed-off-by: Sibei Gao gaosb@inspur.com

* Returns: 0 on success, -ERR# otherwise.
*/
int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_size,
map<string, bufferlist>& attrs,
bool assume_noent, bool modify_tail,
void *_index_op)
void *_index_op, bool completeMultipart)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaosibei is it possible accounted_size could be corrected by the call path leading to _do_write_meta?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the accounted_size could not be corected outside of the _do_write_meta. Because, the accounted_size is both used in quota status and index_op.

at the rgw_rados.cc:6940 (_do_write_meta)
r = index_op->complete(poolid, epoch, size, accounted_size,...)

Copy link
Member

@joscollin joscollin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joscollin
Copy link
Member

@gaosibei No, that's not the tracker for this PR.

@gaosibei
Copy link
Author

@joscollin

sorry

The tracker issue is http://tracker.ceph.com/issues/21586

@gaosibei gaosibei force-pushed the branch2 branch 8 times, most recently from 5a85520 to 97f95e4 Compare October 2, 2017 03:48
Fixes: http://tracker.ceph.com/issues/21586

Signed-off-by: Sibei Gao <gaosb@inspur.com>
@gaosibei
Copy link
Author

gaosibei commented Oct 2, 2017

@mattbenjamin @mdw-at-linuxbox

I think that the accounted_size could not be corected outside of the _do_write_meta.

Because, the accounted_size is both used in quota status and index_op.

at the rgw_rados.cc (_do_write_meta)

  1. r = index_op->complete(poolid, epoch, size, accounted_size,...)
  2. store->quota_handler->update_stats(meta.owner, obj.bucket, (orig_exists ? 0 : 1),
    accounted_size, orig_size);

Now, I give a new commit which seems better than before

Copy link
Contributor

@mdw-at-linuxbox mdw-at-linuxbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the tracker issue is fixed. I tried this out and verified it works.

@mdw-at-linuxbox mdw-at-linuxbox dismissed joscollin’s stale review October 4, 2017 20:12

Tracker issue matches now - so I think your change was made.

@mdw-at-linuxbox mdw-at-linuxbox merged commit b4c0ef0 into ceph:master Oct 4, 2017
@gaosibei gaosibei deleted the branch2 branch October 10, 2017 02:44
@tchaikov
Copy link
Contributor

@mattbenjamin @mdw-at-linuxbox i am marking the tracker ticket with "backport=jewel,luminous" after checking jewel and luminous branches. does it make sense to you guys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants