Percona-Lab / mongodb_consistent_backup

A tool for performing consistent backups of MongoDB Clusters or Replica Sets
https://www.percona.com
Apache License 2.0
276 stars 81 forks source link

Fix S3 upload bug #226

Closed jessewiles closed 6 years ago

jessewiles commented 6 years ago

Proposed fix for: https://github.com/Percona-Lab/mongodb_consistent_backup/issues/187

This fix has a couple of parts. First, it gets rid of the get_key call, which is not necessary for setting the ACL. In our tests, an exception in this get_key call caused the entire upload to fail, which is probably NOT the desired result.

Secondly, this fix uses the set_acl directly on the S3 Bucket object (http://boto.cloudhackers.com/en/latest/ref/s3.html#boto.s3.bucket.Bucket.set_acl). This allows us to avoid the problematic get_key call.

Finally, the exception was blank in our testing. This fix adds an explicit call to traceback to help clarify the cause of the error.

timvaillancourt commented 6 years ago

Hi @jessewiles,

Thanks for your fixes to the S3 Uploader! We will be freezing the code for the next 7 days or so to stabilise the code for the 1.2.0 release during our Percona Live Europe Conference. I'll review this code after that freeze.

jessewiles commented 6 years ago

Thanks Tim! For reference, here's the log which provides context for this particular fix. Cheers.

https://gist.github.com/jessewiles/79da07545a4dffae96c9d986f3bdb6ae

https://gist.github.com/jessewiles/79da07545a4dffae96c9d986f3bdb6ae#file-mongodb_consistent_backup-log-L300

jessewiles commented 6 years ago

Done.

timvaillancourt commented 6 years ago

Thanks @jessewiles!