Skip to content

Conversation

@NaluTripician
Copy link
Contributor

Pull Request Template

Description

This pull request introduces support for passing ItemRequestOptions, including a new AvailabilityStrategy property, through the batch processing pipeline in Azure Cosmos DB. This enables more granular control over request options and availability strategies at the batch operation level. The changes also add a new test to validate the use of custom AvailabilityStrategy in batch upsert operations.

Key changes include:

Batch Processing Pipeline Enhancements:

  • Added an ItemRequestOptions parameter (with support for AvailabilityStrategy) to BatchAsyncBatcher, BatchAsyncStreamer, and related delegate signatures, allowing request options to flow through the batch execution pipeline. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Updated the batch execution logic to use the provided ItemRequestOptions, including copying options where necessary to avoid side effects.

Request Options Extension:

  • Modified TransactionalBatchItemRequestOptions.FromItemRequestOptions to include the new AvailabilityStrategy property, ensuring it is preserved when converting request options for batch items.

Testing:

  • Added a new test (UpsertRequestOptionsTest) in CosmosAvailabilityStrategyTests to verify that the custom AvailabilityStrategy is correctly applied during upsert operations in a multi-region scenario with fault injection.
  • Updated batcher test delegates to accept the new ItemRequestOptions parameter, ensuring all test code aligns with the new delegate signature. [1] [2] [3] [4] [5] [6]

Solution and Project File Updates:

  • Updated the Visual Studio solution file to version 18 and added configuration support for a new project (likely related to the above changes). [1] [2]

These changes collectively improve the flexibility and robustness of batch operations in Cosmos DB by allowing fine-grained request customization and better support for advanced availability strategies.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)

Closing issues

To automatically close an issue: closes #IssueNumber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants