|
35 | 35 | - Added `PartitionKeyDefinition::with_kind(PartitionKeyKind)` and `PartitionKeyDefinition::with_version(PartitionKeyVersion)` consuming setters so callers can override the auto-inferred kind and the default `V2` version without resorting to private-field workarounds. `PartitionKeyDefinition::new(paths)` continues to auto-infer the kind from the path count. |
36 | 36 | - Reshaped `PatchInstructions` API so that `PatchInstructions::new()` creates an empty instruction set, where individual operations can be added via `with_operation()`. The `PatchInstructions` type also implements `From<Vec<PatchOperation>>` for ergonomic construction from a vector. |
37 | 37 | - Refactored the driver response surface: introduced `ResponseBody` (a `NoPayload` / `Bytes(Bytes)` / `Items(Vec<Bytes>)` enum with `single()`, `items()`, `into_single::<T>()`, `into_items::<T>()`, and `is_empty()` helpers), added typed `CosmosRequestHeaders` fields for query / changefeed headers (`max_item_count`, `incremental_feed`, `populate_index_metrics`, `populate_query_metrics`, `enable_cross_partition_query`) so callers no longer need raw `custom_headers`, the pipeline now auto-emits `x-ms-documentdb-isquery: True` and `Content-Type: application/query+json` for `OperationType::Query`, and `CosmosStatus` gained `PartialEq<StatusCode>`, `From<CosmosStatus> for StatusCode/u16`, and a `CosmosStatus::new(StatusCode)` constructor. ([#4401](https://github.com/Azure/azure-sdk-for-rust/pull/4401)) |
| 38 | + |
| 39 | +- Added the cross-SDK Hedging Detection API accessors on `DiagnosticsContext`: `requested_regions() -> Vec<RequestedRegion>` (dispatch order, duplicates allowed, each entry tagged with a `RequestedRegionReason`), `responded_regions() -> Vec<&Region>` (arrival order by completion time, duplicates allowed, service replies only), and `hedging_started() -> bool` (`true` only once a hedge fan-out is dispatched). Added the public `RequestedRegion` struct and `RequestedRegionReason` enum (both `#[non_exhaustive]`, re-exported by `azure_data_cosmos`) plus a `From<ExecutionContext>` mapping. `TransportRetry` and `CircuitBreakerProbe` reasons are reserved and not populated by the initial implementation. ([#4558](https://github.com/Azure/azure-sdk-for-rust/pull/4558)) |
38 | 40 | - Added support for the `x-ms-cosmos-hub-region-processing-only` request header on retries after a `404 / 1002 (READ_SESSION_NOT_AVAILABLE)` response on single-master data-plane Cosmos operations. The header asks the backend to route only to a region that has caught up to the requested LSN, reducing the chance of a follow-up retry hitting a region whose session is also behind. The header is scoped to single-master accounts (multi-master accounts already have a different recovery path) and to data-plane operations (metadata-pipeline operations are out of scope per the design spec). Once latched on the first 1002 within an operation, the header is emitted on every subsequent retry for that operation. ([#4389](https://github.com/Azure/azure-sdk-for-rust/pull/4389)) |
39 | 41 | - Added local query-plan generator scaffolding under `crate::query` (lexer, parser, AST, planner, and in-memory evaluator). The scaffolding is **not wired into the production query path** yet — production callers still issue Gateway query-plan requests via `CosmosOperation::query_plan`. The `__internal_testing` cargo feature exposes `query::__test_only_generate_query_plan_for_pk_paths`, `query::__TEST_ONLY_SUPPORTED_QUERY_FEATURES`, and `CosmosOperation::query_plan` for cross-crate gateway-comparison tests; this feature is intentionally unstable and **not covered by SemVer**. |
40 | 42 | - Added per-partition automatic failover (PPAF) for writes on single-master accounts. On 403/3 WriteForbidden, 503 ServiceUnavailable, 429/3092 SystemResourceUnavailable, 410/1022 Gone, or 408 RequestTimeout from a region, the affected partition is failed over to the next preferred region; subsequent writes for that partition skip the failed region. ([#4156](https://github.com/Azure/azure-sdk-for-rust/pull/4156)) |
|
48 | 50 | - Renamed the error surface: `Error` → `CosmosError`, `ErrorBuilder` → `CosmosErrorBuilder`. Categorization moved from a `Kind` enum to predicates on `CosmosStatus` (`is_not_found()`, `is_throttled()`, `is_transient()`, …); error details are reached via `status()` and `response()` instead of the previous flat accessors. ([#4442](https://github.com/Azure/azure-sdk-for-rust/pull/4442)) |
49 | 51 | - Renamed `MaxItemCount` to `MaxItemCountHint` to better reflect that the value is a hint to the service (which may return fewer items) rather than a strict cap. The SDK already exposed the type under the new name via a `use ... as MaxItemCountHint`; the rename makes the canonical name consistent across both crates. Update callers that reference `azure_data_cosmos_driver::models::MaxItemCount`, `CosmosRequestHeaders::max_item_count` typings, or `CosmosOperation::with_max_item_count` argument types accordingly. |
50 | 52 | - Marked `PartitionKeyVersion` and `CosmosStatus` as `#[non_exhaustive]` to allow future variants/fields to be added without further breaking changes. Callers must use `..` wildcard arms when matching on `PartitionKeyVersion`; `CosmosStatus` already had private fields and is constructed via `CosmosStatus::new` / `with_sub_status`, so the attribute is primarily a forward-compat signal. |
| 53 | +- Renamed `ExecutionContext::Retry` to `ExecutionContext::OperationRetry` to align with the cross-SDK reason taxonomy (`OperationRetry` distinguishes operation-level retries from `TransportRetry`). The serialized diagnostics string changes from `"retry"` to `"operation_retry"`; the old variant is retained as `#[deprecated]` for one release. Telemetry parsers that match on the string `"retry"` must be updated. (No `#[serde(rename = "retry")]` is applied.) ([#4558](https://github.com/Azure/azure-sdk-for-rust/pull/4558)) |
51 | 54 | - Slimmed the cached `PartitionKeyRange` to six fields, dropping eight metadata fields the routing-map cache never reads (`resource_id`, `self_link`, `etag`, `timestamp`, `rid_prefix`, `target_throughput`, `lsn`, `owned_archival_pk_range_ids`). The struct now retains the four fields the routing layer consults (`id`, `min_inclusive`, `max_exclusive`, `status`) plus `throughput_fraction` and `parents`, kept on the cached representation for downstream consumers that read them directly. As part of this change, `PartialEq` and `Hash` no longer hash `resource_id`: two ranges with the same `id` / `min_inclusive` / `max_exclusive` are now equal regardless of their `_rid`. Internal callers never used `PartitionKeyRange` as a hash-map key, but downstream consumers that did so should review their assumptions. Service responses are unchanged on the wire — the dropped JSON fields are silently ignored by serde on deserialization. ([#4393](https://github.com/Azure/azure-sdk-for-rust/pull/4393)) |
52 | 55 | - Changed `CosmosResponse::diagnostics()` to return `Arc<DiagnosticsContext>` instead of `&DiagnosticsContext`. The returned `Arc` derefs transparently for read-only inspection (existing call patterns like `response.diagnostics().activity_id()` continue to work), but bindings of the form `let d = response.diagnostics();` now own a cloned `Arc` handle rather than a borrow — letting callers retain operation diagnostics across `into_body()`. Replaces the additive `CosmosResponse::diagnostics_arc()` accessor introduced earlier in this preview cycle. |
53 | 56 | - Removed `CosmosResponse::body() -> &[u8]`. The previous accessor panicked on multi-item feed bodies, which is unsafe for a public API. The non-consuming `body_parts() -> &ResponseBody` accessor has been renamed to `body()`. Callers needing borrowed access should pattern-match on `ResponseBody::Bytes(b)` / `ResponseBody::Items(items)`; consuming callers can use `into_body().single_item::<T>()` or `into_body().single()`. |
|
0 commit comments