[Storage Blob] Question about blob batch operation
See original GitHub issue- Package Name: @azure/storage-blob
- Package Version: 12.2.1
- Operating system: macOS
- [ x] nodejs
- version: 10.16.3
- browser
- name/version:
- typescript
- version:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug Not really a bug bit more of a clarification question.
I am using blob batch operation to delete a number of blobs from a container. My question is about the order of sub responses I receive as a response to a batch operation - will the sub responses match the order in which the original request was sent?
To elaborate, let’s say I am deleting 100 blobs in a batch request. Let’s assume that the blobs are named like ‘00.txt’, ‘01.txt’, ‘02.txt’, … ‘99.txt’. I am creating the batch request and creating subrequests by adding the blobs in this order. Now when I get the response, can I assume that sub responses will be returned in the same order? i.e. 1st element of sub response array will be for ‘00.txt’, 2nd element will be for ‘01.txt’ and so on.
The reason I ask this is because the REST API documentation
states the following:
There are no guarantees on the order of execution of the batch subrequests.
In my testing so far, I have noticed that the sub response array is actually ordered properly however I would like to know conclusively that this is how it would always work.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
We could. But would that help? Or is it still cumbersome for you?
I would prefer to do the re-ordering in our SDK since we already store the map from requestId to the original requests. This is not done in other languages though. What do you think? @bterlson @xirzec @jeremymeng @jiacfan @XiaoningLiu @kasobol-msft
There is no documentation on whether the subresponses from the service are ordered. And our SDK doesn’t re-order. Even though we have some test cases assuming it’s ordered and they have never broke, I still suggest we shouldn’t expect them to be in order as it’s not promised.
We have a
_request
field containing the the corresponding subrequst in each sub response. Better to check it before proceeding.