You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Cosmos DB has a limit in the request size to 2Mb. When Bulk is used, the SDK applies hashing to distribute documents across partitions/batches and then sends them:
…ize. (#23987)
### Packages impacted by this PR
@azure/cosmos
### Issues associated with this PR
#23923
### Describe the problem that is addressed by this PR
CosmosDB Items.bulk api doens't honour 2Mb cap imposed on a single batch
request. With these changes if size of a batch (cumulative size of it's
operations) exceeds 2Mb it is split into smaller batches before sending.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
Yes
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
---------
Co-authored-by: FAREAST\vikassingh <vikassingh@microsoft.com>
Describe the bug
Cosmos DB has a limit in the request size to 2Mb. When Bulk is used, the SDK applies hashing to distribute documents across partitions/batches and then sends them:
azure-sdk-for-js/sdk/cosmosdb/cosmos/src/client/Item/Items.ts
Lines 403 to 471 in e6dbd47
For each batch (physical partition) it will send 1 request with all the operations.
The problem is that the volume of operations for a single partition can exceed the 2Mb, there is no limiting or filtering happening.
In other Cosmos DB SDKs with Bulk, there is a size limiting factor being applied:
To Reproduce
Expected behavior
The SDK would split the operations into requests less than 2Mb size
The text was updated successfully, but these errors were encountered: