[Internal] DTS: Adds logic to build request and parse response#5576
Merged
kirankumarkolli merged 14 commits intomasterfrom Feb 6, 2026
Merged
[Internal] DTS: Adds logic to build request and parse response#5576kirankumarkolli merged 14 commits intomasterfrom
kirankumarkolli merged 14 commits intomasterfrom
Conversation
aa71daf to
a488913
Compare
| private void EnrichRequestMessage(RequestMessage requestMessage, DistributedTransactionRequest transactionRequest) | ||
| { | ||
| // Set DTC-specific headers | ||
| requestMessage.Headers.Add("x-ms-dtc-version", "0.0"); |
Contributor
There was a problem hiding this comment.
I believe we have httpconstants.cs, moving these headers to central location will be better
| this.operationResizableWriteBuffer = new MemorySpanResizer<byte>(estimatedMaxOperationLength + operationSerializationOverheadOverEstimateInBytes); | ||
|
|
||
| Result r = await this.bodyStream.WriteRecordIOAsync(default, this.WriteOperation); | ||
| Debug.Assert(r == Result.Success, "Failed to serialize distributed transaction request"); |
Contributor
There was a problem hiding this comment.
Here this should ideally be exception. It would possibly eliminate the check here: https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5576/changes#diff-8da7da32691191fb49279546f3936019368f6db95a04a7992f6fb1e065ffa074R70
kirankumarkolli
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The main changes in this PR include -
DistributedTransactionCommitterclass that manages the commit process for distributed transactions, including request enrichment, error handling, and a placeholder for abort logic.DistributedTransactionCommitterUtilswith a method to resolve collection resource IDs (RIDs) for all operations in a transaction, ensuring correct routing and execution.DistributedTransactionRequestclass to encapsulate transaction operations and associated metadata, such as idempotency tokens and operation types.CosmosClientto pass theClientContextwhen creating aDistributedWriteTransactionCore, enabling downstream components to access necessary context for transaction execution.# Pull Request TemplateThese updates lay the groundwork for executing distributed transactions with better serialization, error handling, and request management.
TODO: Add comprehensive tests to test the end-to-end flow of DTS in SDK
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber