[Cosmos][Spec] Adopt cross-SDK Hedging Detection API on DiagnosticsContext#4411
Draft
NaluTripician wants to merge 2 commits into
Draft
Conversation
…ntext Adds sdk/cosmos/azure_data_cosmos/docs/HEDGING_DETECTION_API_SPEC.md describing the cross-SDK Hedging Detection API for the Rust SDK. Spec-only PR — no production code changes. Sequenced after PR Azure#4330 and before any hedging implementation PR. Refs Azure#4410 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Draft. This PR adopts the cross-SDK Hedging Detection API for the Rust SDK as a spec-only change. Refs #4410.
Targets
release/azure_data_cosmos-previews(same as #4330). Doc-only — exactly one file changed.What this PR does
Adds
sdk/cosmos/azure_data_cosmos/docs/HEDGING_DETECTION_API_SPEC.md, which specifies three additive accessors onDiagnosticsContext(CosmosDiagnosticsContextre-export):hedging_started() -> boolrequested_regions() -> Vec<&Region>(dispatch order, dups allowed)responded_regions() -> Vec<&Region>(completion order, dups allowed)plus the
Retry → OperationRetryrename mechanics, the public re-export decision, and a reconciliation table against #4330'sHEDGING_SPEC.md§10.What this PR does NOT do
No production code. No tests. No CHANGELOG (drafted in the spec; landed by the future implementation PR).
Sequencing
HEDGING_SPEC.mdand thehedge_diagnostics: Option<HedgeDiagnostics>design contract ontorelease/azure_data_cosmos-previews.HedgeDiagnostics, emitsExecutionContext::Hedging).Retry → OperationRetryrename, lands the CHANGELOG entries drafted here).Cross-references
3647b404e5366e1e91344ffa5a5929a7a6845c38at the time this draft opens — cited in the spec's reconciliation table per SE-023 mitigation step (a)).Cross-SDK gate decisions reflected here
ExecutionContextACCEPTED. New variant serializes as"operation_retry";#[serde(alias = "retry")]preserves back-deserialization; CHANGELOG entries on both crates explicit. No#[serde(rename = "retry")].ExecutionContextstays driver-private)Reviewers
cc @kundadebdatta @analogrelay @FabianMeiswinkel @simorenoh @NaluTripician
CODEOWNERS will auto-add
@Azure/azure-cosmos-rust-sdk.Refutations of cross-SDK design doc §10 (carried in spec §2 / §4.2)
ExecutionContext::Hedgingis not dispatched today (onlyInitial,Retry,TransportRetry,RegionFailoverare emitted).ExecutionContextandRequestDiagnosticsare not re-exported fromazure_data_cosmos.Retry → OperationRetryrename cannot be a#[deprecated]re-export — Rust has no enum-variant aliases. The correct mechanism is#[non_exhaustive]+ new variant +#[deprecated]on the old variant + dispatch-site updates +#[serde(alias = "retry")]on the new variant.HedgeDiagnosticsfield coexist; reconciliation table in spec §6.