You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A cosmosdb instance was created in SouthEastAsia region with "Session" default consistency. The following C# code was used to create a DB if not exist:
This throws a System.ArgumentException saying "Consistency level Bounded Staleness specified in the request is invalid when service is configured with consistency level Session". This error it self is wrong as Bounded Staleness was not mentioned in the code. If ConsistencyLevel = ConsistencyLevel.Eventual is used in the cosmosClientOptions there error does not appear.
To Reproduce
Create a cosmos db instance with Session default consistency level
Try to create a database in the cosmosdb instance via a code similar to the above - an exception will be thrown.
Expected behavior
There should not be any error if the cosmos client if instantiated with a weaker consistency than the default constituency defined in the cosmosdb instance.
Actual behavior
A misleading exception is being thrown.
Environment summary
SDK Version: Microsoft.Azure.Cosmos 3.16.0
Framework: .NET Core 3.1
OS Version: Windows 10 20H2 19042.746
@IshamMohamed I found the bug. It's incorrectly converting the consistency levels. I'll send out a fix. This seems to have existed since 3.1.0. The fix will be released in the next few weeks.
The problem exists in: https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.16.0 (the latest version of v3 client) and does not exist in https://www.nuget.org/packages/Azure.Cosmos/4.0.0-preview3 (latest v4 preview client)
Describe the bug
A cosmosdb instance was created in SouthEastAsia region with "Session" default consistency. The following C# code was used to create a DB if not exist:
This throws a
System.ArgumentException
saying"Consistency level Bounded Staleness specified in the request is invalid when service is configured with consistency level Session"
. This error it self is wrong as Bounded Staleness was not mentioned in the code. IfConsistencyLevel = ConsistencyLevel.Eventual
is used in thecosmosClientOptions
there error does not appear.To Reproduce
Session
default consistency levelExpected behavior
There should not be any error if the cosmos client if instantiated with a weaker consistency than the default constituency defined in the cosmosdb instance.
Actual behavior
A misleading exception is being thrown.
Environment summary
SDK Version: Microsoft.Azure.Cosmos 3.16.0
Framework: .NET Core 3.1
OS Version: Windows 10 20H2 19042.746
Additional context
https://pbs.twimg.com/media/EtmPEIJU0AMtqvA?format=png&name=large
The text was updated successfully, but these errors were encountered: