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
To make it explicit that WriteInitToken is the result of WriteInit, the following "API" would be more intuitive:
SomeAction==/\CosmosDB!WriteInit("k","v",LAMBDAt:token'=t)\* Def of WriteInit in CosmosDB.tlaWriteInitToken==[epoch|->epoch,checkpoint|->Len(log)+1\* checkpoint |-> Len(log')]WriteInit(key,value,Op(_))==/\log'=Append(log,[key|->key,value|->value])/\Op(WriteInitToken)
Additionally, I propose to include the key and value in WriteInitToken to free a client spec of ComosDB.tla from manually keeping track of the relationship:
WriteInitToken(key,value)==[epoch|->epoch,checkpoint|->Len(log)+1,key|->key,value|->value]\* This operator initiates a write, adding it to the log.\* It is only useful alongside other constructs, such as:\* - WritesAccepted\* - WriteInitTokenWriteInit(key,value,Op(_))==/\log'=Append(log,[key|->key,value|->value])/\Op(WriteInitToken(key,value))SessionTokenIsValid(token)==SessionTokenLEQ(token,WriteInitToken(token.key,token.value))
Client:
12FrontendWrite==/\future=Nil/\\Er\inrequests:DB!WriteInit(r.key,r.val,LAMBDAt:future'=t)/\UNCHANGED<<dbVarsLog,requests,queue,backend>>34FrontendEnqueue==/\future#Nil/\DB!WriteSucceed(future)\* Make use of the key and value kept in the write token./\requests'=requests\{[key|->future.key,val|->future.value]}/\queue'=Append(queue,[k|->future.key,t|->future])/\future'=Nil/\UNCHANGED<<dbVars,backend>>
In the simple model, writing to the database looks like this:
To make it explicit that
WriteInitToken
is the result ofWriteInit
, the following "API" would be more intuitive:Additionally, I propose to include the key and value in WriteInitToken to free a client spec of ComosDB.tla from manually keeping track of the relationship:
Client:
/cc @fhackett
The text was updated successfully, but these errors were encountered: