Change Feed continuity after a failed upgrade to Cosmos DB API v2.0.0 Full Fidelity mode
0 reputation · 29 Nov 2025, 17:31 UTC
0 reputation · 29 Nov 2025, 17:31 UTC
The goal is to understand whether Cosmos DB Change Feed guarantees exactly‑once processing of pre‑upgrade changes when a move to API v2.0.0 Full Fidelity mode fails and the account reverts to the legacy API.
Constraints include the lack of automatic checkpoint migration during version changes, the possibility that a processor already switched to Full Fidelity retains its configuration after rollback, and undocumented behavior for events occurring between the last legacy checkpoint and the failed upgrade.
Does the Change Feed processor automatically reconcile its checkpoints after a rollback to the legacy API?
What manual actions are required to prevent duplicate or missed events for changes made after the last legacy checkpoint but before the upgrade failure?
Is there a supported method to validate or migrate checkpoints when reverting to the previous API version?
The Change Feed processor does **not** automatically reconcile its checkpoints after a rollback from API v2.0.0 Full Fidelity mode to the legacy API.
When the upgrade fails, the processor may have already written lease documents using the new SDK while still targeting the legacy API after rollback. The lease token format is unchanged, but the processor’s internal continuation token can become stale or mismatched, causing it to either restart from the beginning or throw a lease‑mismatch error.
leases) stores continuation tokens and is **not** altered by switching between API versions; the lease schema is identical for legacy and Full Fidelity modes.az cosmosdb sql container show \
--account-name \
--resource-group \
--database-name \
--name leases \
--query "id"
Then list a few lease items to see Owner and Continuation fields.LeaseOptions.LeasePrefix) that were used before the upgrade.Lease acquired and the continuation token value. If you see Lease lost or Renew failed errors, the lease may be corrupted.Owner=null or missing Continuation tokens, consider **resetting** the lease container (delete lease documents) and let the processor re‑acquire leases, accepting that pre‑upgrade changes will be reprocessed.To decide whether a simple restart suffices or a lease reset is required, we need to know: What is the current state of the lease container after the failed upgrade? Specifically, are any lease documents missing the Owner field or have stale Continuation values? This detail changes the recommendation from “restart only” to “reset lease container”.
Use comments to ask for clarification. Post a solution as an answer.
34,275 reputation · 29 Nov 2025, 22:28 UTC
The Change Feed processor does not automatically reconcile its checkpoints after a rollback from API v2.0.0 Full Fidelity mode to the legacy API. While the lease container schema remains consistent, the internal continuation token generated by the newer SDK may become stale or incompatible with the legacy API state.
To prevent duplicate or missed events occurring during the window between the last legacy checkpoint and the upgrade failure, consider these steps:
Continuation field in your lease documents. If the token was updated during the Full Fidelity attempt, the legacy processor may fail to parse it or skip events.Always verify that the SDK version used post-rollback is compatible with the legacy API to avoid lease-mismatch errors during initialization.