-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A very hacky implementation of managed transfers for s3
Adds a new option `--managed-transfer` to `barman-cloud-backup` which, if used with the `aws-s3` cloud provider, causes the backup objects to be uploaded in single calls to boto3 - boto3 then manages the transfer itself, potentially using the multipart API if necessary. This allows backup uploads to use a TransferConfig object which allows things like bandwidth limits to be set. This commit adds such a TransferConfig which hard codes a bandwidth limit of 1MB/s. Not practically much use but we just want to see something working at this point. The implementation is by creating a specialisation of S3CloudInterface where the `MAX_CHUNKS_PER_FILE` is set to `1` and the `MIN_CHUNK_SIZE` is set to the `MAX_ARCHIVE_SIZE` value. This means each backup object (e.g. data_0000.tar)is uploaded in a single call to _upload_part which now just redirects to upload_fileobj. upload_fileobj is updated to add a TransferConfig which could add various options supplied by the user. The remaining multipart methods are turned into noop methods which just return whatever is expected by the existing backup upload code that relies on CloudInterface.
- Loading branch information
1 parent
d8ae97c
commit 392edcb
Showing
3 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters