Skip to content

[BUG] Cosmos P1: Failed change-feed initialization can permanently omit partitions #51135

Open

Description

Describe the bug
Alan Zimmer's November 6, 2026 audit of com.azure:azure-cosmos:4.84.0-beta.1 reports that EPK change-feed initialization swallows terminal partition-discovery or lease-creation failures as successful completion. Subsequent initialization-marker writes can record incomplete initialization as complete. Normal load balancing does not create missing leases, so some or all partitions can remain unprocessed across restarts.

This affects fresh handleLatestVersionChanges initialization and, under default options, all-versions-and-deletes processing. Latest-version startup also ignores the optional restart-verification safeguard. Reported priority: P1; silent data omission while reporting success.

Exception or Stack Trace
Not supplied; the reported failure is swallowed.

To Reproduce
Inject a terminal discovery or lease-creation failure during fresh initialization, then allow subsequent initialization-marker writes to succeed. Restart the processor and inspect lease coverage and processing across partitions. This is a proposed regression scenario, not a runtime reproduction from the audit.

Code Snippet
Not supplied. Reported location: EPK PartitionSynchronizerImpl.java:73-81 in the audited source; line numbers may move.

Expected behavior
Initialization failures propagate, and initialization is marked complete only after required lease coverage is established. A retry must create all required leases.

Screenshots
N/A.

Setup (please complete the following information):

  • OS: Not reported.
  • IDE: Not reported.
  • Library/Libraries: com.azure:azure-cosmos:4.84.0-beta.1.
  • Java version: Not reported.
  • App Server/Environment: Change Feed Processor with EPK leases.
  • Frameworks: Not reported.

Dependency mismatch: Not indicated; dependency tree/logs were not supplied.

Additional context
Proposed fix from the audit: propagate initialization failures; write the initialized marker only after lease coverage is established.

Regression coverage: inject terminal discovery and creation failures, assert that no initialized marker is written, and verify that a retry creates every required lease.

Evidence: Alan source-traced this finding through callers and recovery paths; it was not runtime-reproduced. No live Cosmos calls or full SDK test suite were run, and no repository files were changed. This issue tracks validation and implementation of the proposed fix, not an already-applied fix. Alan recommended addressing this finding and the non-streaming vector TOP finding first.

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Cosmos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions