question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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

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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ljian3377commented, Nov 11, 2020

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

1reaction
ljian3377commented, Nov 10, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Storage Blobs Batch client library for .NET
This library allows you to batch multiple Azure Blob Storage operations in a single request.
Read more >
Azure Storage Blobs Batching client library for .NET
This library allows you to batch multiple Azure Blob Storage operations in a single request. Source code | Package (NuGet) | API reference...
Read more >
Azure Blob storage batch update. Possible? - Stack Overflow
UpdateMetadataAsync() and run them concurrently via Task.WhenAll(). All in all, it takes around 10 seconds on my machine for the whole process.
Read more >
Azure.Storage.Blobs.Batch 12.1.1 - NuGet
This client library allows you to batch multiple Azure Blob Storage operations in a single request. For this release see notes ...
Read more >
A Complete Guide On Microsoft Azure Batch - MindMajix
First, you need to upload your data files to the Azure storage account. Batch has built-in support for accessing blob storage. While you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found