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

Ensure no mp uploads remaining in bucket creation and deletion #857

Merged
merged 1 commit into from
May 16, 2014

Conversation

kuenishi
Copy link
Contributor

(rebased version of #856)

There was a security issue that flaws remaining multipart uploads,
where an newly created bucket may include unaborted or uncompleted
multipart uploads which was created in previous epoch of the bucket
with same name. This commit fixes it by:

  • on creating buckets;
    • check if live multipart exists
    • if exists, return 500 failure to client
  • on deleting buckets;
    • try to clean up all live multipart remains
    • check if live multipart remains (in stanchion)
    • if exists, return 409 failure to client
  • after upgrading from 1.4.x (or former) to 1.5.0;
    • run riak_cs_console:cleanup_orphan_multipart/0 or
      riak_cs_console:cleanup_orphan_multipart/1 in an
      attached console to cleanup all buckets
    • there might be a time period until above cleanup
      finished, where no client can create bucket if
      unfinished multipart upload remains under deleted
      bucket. You can find [critical] log if such bucket
      creation is attempted.

This commit also inclues:

  • cut out bucket related operations from riak_cs_utils to riak_cs_bucket
  • riak_test (riak_cs_buckets_test) to check bucket related tests

There was a security issue that flaws remaining multipart uploads,
where an newly created bucket may include unaborted or uncompleted
multipart uploads which was created in previous epoch of the bucket
with same name. This commit fixes it by:

- on creating buckets;
  - check if live multipart exists
  - if exists, return 500 failure to client
- on deleting buckets;
  - try to clean up all live multipart remains
  - check if live multipart remains (in stanchion)
  - if exists, return 409 failure to client

- after upgrading from 1.4.x (or former) to 1.5.0;
  - run `riak_cs_console:cleanup_orphan_multipart/0` or
    `riak_cs_console:cleanup_orphan_multipart/1` in an
    attached console to cleanup all buckets
  - there might be a time period until above cleanup
    finished, where no client can create bucket if
    unfinished multipart upload remains under deleted
    bucket. You can find [critical] log if such bucket
    creation is attempted.

This commit also inclues:
- cut out bucket related operations from riak_cs_utils to riak_cs_bucket
- riak_test (riak_cs_buckets_test) to check bucket related tests
@shino
Copy link
Contributor

shino commented May 14, 2014

@kuenishi dialyzer emitted some warnings.

dialyzer: Could not merge PLTs since they are not disjoint
The following files are included in more than one PLTs:
["xmerl.beam","xmerl_b64Bin.beam","xmerl_b64Bin_scan.beam",
 "xmerl_eventp.beam","xmerl_html.beam","xmerl_lib.beam","xmerl_otpsgml.beam",
...

PLT cleanup needed?

@kuenishi
Copy link
Contributor Author

Yeah, we made it dirty again.

@shino
Copy link
Contributor

shino commented May 15, 2014

all riak_test passed.
+1 from me 😄

@shino
Copy link
Contributor

shino commented May 16, 2014

+1 1447cc3

borshop added a commit that referenced this pull request May 16, 2014
…hed-rebased

Ensure no mp uploads remaining in bucket creation and deletion

Reviewed-by: shino
@kuenishi
Copy link
Contributor Author

@borshop merge

@borshop borshop merged commit 1447cc3 into develop May 16, 2014
@kuenishi kuenishi deleted the bugfix/cs475-check-mpuploads-squashed-rebased branch June 26, 2014 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants