Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change #1: Fix non-multipart uploads
This fixes an issue where we free the buffer before writing it in the
non-multipart upload path, which can be used for quicker small writes.
Adds an associated unit test.
Change #2: Missing error return path in blob flush
In the blob flush path for multipart uploads, the last flush of the write
cache may silently fail. This ensures the user receives a non-OK status
from flush_blob() in this scenario.
Change #3: Multipart uploads fail when they have > 10 chunks
In a the multipart upload (aka blocklist upload), each chunk is uploaded
a block with a string-id unique to the overall object (aka blob). There is
an undocumented requirement that all decoded string-ids must be of
equal length. Note that string-ids are b64 encoded/decoded in the REST
request.
Currently, the string-ids are generated from an incrementing integer. For
example, the id of the first chunk is "0", the second chunk is "1", the
tenth chunk is "9", and the eleventh chunk is "10". The eleventh chunk
has a string-id size of 2 while all the others have a size of 1. The
eleventh chunk (and all other future chunks) fail with the following
error message:
This patches pads the string-ids to ensure they are all 5-characters long.
The maximum number of chunks is 50,000 so 5-characters is sufficient to
contain all chunk ids.
More info here:
https://gauravmantri.com/2013/05/18/windows-azure-blob-storage-dealing-with-the-specified-blob-or-block-content-is-invalid-error/