Closed d6teo closed 3 weeks ago
Based on the public documentation: https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels#session-consistency
... This guarantee assumes a single “writer” session or sharing the session token ...
If the client didn't initiate a write to a physical partition, the client doesn't contain a session token in its cache and reads to that physical partition behave as reads with Eventual Consistency...
What you are describing is that the writer of the initial operation is not passing the SessionToken to the other clients, thus, you are really using Eventual Consistency.
There are no guarantees in that consistency of when there will be convergence.
@ealsur Thanks for the explanation & for providing the link to documentation.
Describe the bug We have a Single-region account with Session consistency that is utilized by multiple v3 SDK clients (across multiple processes). All SDK clients live inside APIs hosted in Azure K8s.
After executing a large number of write operations using an SDK client (client X), some of the other SDK clients (clients Y,Z,...) do not fetch the items included in some of the write operations of client (X).
CosmosClient
is setup with the configuration below:This is more of a question rather than a bug report: -Is there any guarantee/threshold/estimation of how long it may take for different sessions to "converge"(produce the same result set for the same query)? -Is there any way to update session info on SDK clients apart from using session tokens (e.g. recycling an SDK client)?
Expected behavior Clients Y,Z,... should produce consistent result sets for the same query after a certain amount of time.
Actual behavior Clients Y,Z,... produce inconsistent result sets for the same query several hours after the write operations.
Environment summary Azure CosmosDB account region: South Central US SDK Version: 3.29.0 SDK host: Docker container/Azure K8S OS Version (e.g. Windows, Linux, MacOSX): Debian GNU/Linux 11 (bullseye)