Skip to content

Feed Operations Spec (Attempt #2)#4327

Open
analogrelay wants to merge 13 commits intoAzure:release/azure_data_cosmos-previewsfrom
analogrelay:ashleyst/feed-operations
Open

Feed Operations Spec (Attempt #2)#4327
analogrelay wants to merge 13 commits intoAzure:release/azure_data_cosmos-previewsfrom
analogrelay:ashleyst/feed-operations

Conversation

@analogrelay
Copy link
Copy Markdown
Member

After the branch for #4261 got unintentionally deleted from my fork, I had to open a new PR for this branch, even when I restored the branch. So that's this 🥴

analogrelay and others added 10 commits April 22, 2026 23:24
Defines the design for feed operations (queries, read-many, change feed)
in the driver crate, covering the Plan → Execute model,
OperationPayload/OperationTarget refactors, continuation tokens,
OpenTelemetry integration, and partition split handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Incorporates Java SDK comparison findings: O(1) continuation tokens
using nested ResumeState tree, unified execute_operation API, simplified
OperationPlan enum (Trivial/MultiStep), restored PartitionKey targeting,
ORDER BY filter injection via placeholder, and renamed
execute_operation_pipeline to execute_single_operation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces §8 with Turn/Step/Request diagnostics structure. The driver
provides structured timing and concurrency data via raw timestamps;
the SDK computes derived values and creates OTEL spans. Introduces
TurnDiagnostics and StepDiagnostics with enqueued/started/completed
timestamps for concurrency observation. Computed fields (wait time,
execution time, max concurrent steps) are omitted to minimize memory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address findings from 9 parallel review agents:

- Fix stale execute_operation_pipeline reference in §5.3 diagram
- Consolidate resume strategy: §5.5 now summarizes and points to §7.3
- Add backend query plan caching as §2 open issue
- Note EffectivePartitionKey needs Ord for EpkRange<EPK> (§3.2)
- Clarify phasing: spec complete at ReadMany; cross-partition
  query details are forward-looking and not locked
- Use Arc<CosmosOperation> in PlanStep::Fetch for fan-out sharing
- Add wall_clock_start/start_instant to TurnDiagnostics for OTEL
- Add StepOutcome enum to StepDiagnostics for non-HTTP step errors
- Minor grammar and code fence fixes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The cached operation plan already subsumes the backend query
plan, which the Planner consumes during planning and does not
need afterward. No separate caching mechanism is needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 1, 2026 22:13
@analogrelay analogrelay requested a review from a team as a code owner May 1, 2026 22:13
@github-actions github-actions Bot added the Cosmos The azure_cosmos crate label May 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new design spec describing how feed operations (starting with ReadAll; extensible to queries/ReadMany/change feed) should be integrated into azure_data_cosmos_driver via a unified Plan → Execute model, continuation tokens, and hierarchical diagnostics—so feed operations can use the driver’s existing pipeline (failover/retry/diagnostics/etc.).

Changes:

  • Introduces a comprehensive feed-operations architecture spec (planner, plan graph model, executor).
  • Specifies a versioned continuation token format (base64url JSON) and resume semantics resilient to splits/merges.
  • Defines a hierarchical diagnostics shape (plan → node → request) and outlines how to preserve backward compatibility.

Comment thread sdk/cosmos/azure_data_cosmos_driver/docs/FEED_OPERATIONS_SPEC.md Outdated
Comment thread sdk/cosmos/azure_data_cosmos_driver/docs/FEED_OPERATIONS_SPEC.md Outdated
Comment thread sdk/cosmos/azure_data_cosmos_driver/docs/FEED_OPERATIONS_SPEC.md Outdated
Comment thread sdk/cosmos/azure_data_cosmos_driver/docs/FEED_OPERATIONS_SPEC.md Outdated
Comment thread sdk/cosmos/azure_data_cosmos_driver/docs/FEED_OPERATIONS_SPEC.md Outdated
@analogrelay analogrelay force-pushed the ashleyst/feed-operations branch from acedcd5 to 3d32bbb Compare May 5, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cosmos The azure_cosmos crate

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants