-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Scenario1,Scenario2] Session property holds despite Cosmos operating under Eventual consistency #3
Comments
The issue in general-model was, we only allow clients writes to its own region. (* Regular write at write region *)
macro write(v)
{
with (w \in WriteRegions)
{
when \A i, j \in Regions : Data[i] - Data[j] < Bound;
Database[w] := Append(@, v);
Data[w] := v;
History := Append(History, [type |-> "write",
data |-> v,
region |-> w,
client |-> self]);
session_token := v;
}
} It seems my account cannot send PR for this or original repo. Can you please help verify and update? Thanks. |
The spec |
"In session consistency, within a single client session reads are guaranteed to honor the consistent-prefix, monotonic reads, monotonic writes, read-your-writes, and write-follows-reads guarantees." https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels#session-consistency.
Checking the property
Session
with constantConsistency = "Eventual"
inscenario1/swscop.tla
(andscenario2/swscrw.tla
) does not cause a violation (Session
holds), even though reads are not monotonic. With the definition ofSession
strengthened by asserting monotonic reads, the property no longer holds, which is the expected behavior. Note that the original definition ofSession
is not violated by non-monotonic reads because the value ofses[1]
(session token) will be non-monotonic under eventual consistency.Original variant of Session:
Reproducible with the following TLC config file
swscop.cfg
:The text was updated successfully, but these errors were encountered: