weixin_39646970
weixin_39646970
2020-12-08 20:00

Fix S3 upload bug

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.

该提问来源于开源项目:Percona-Lab/mongodb_consistent_backup

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39976575 weixin_39976575 5月前

    Hi ,

    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.

    点赞 评论 复制链接分享
  • weixin_39646970 weixin_39646970 5月前

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

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

    • Notice this section to see the upload complete successfully, but the subsequent HEAD call to get the key triggers failure cleanup:

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

    点赞 评论 复制链接分享
  • weixin_39646970 weixin_39646970 5月前

    Done.

    点赞 评论 复制链接分享
  • weixin_39976575 weixin_39976575 5月前

    Thanks !

    点赞 评论 复制链接分享

相关推荐