KVSAcquireLock¶
- from Mempool Worker
Purpose¶
Inform the shard about keys that a transaction may/will read and/or write, at a transaction fingerprint.
Structure¶
Field | Type | Description |
---|---|---|
lazy_read_keys |
KVSKey set | Keys this transaction may read (only send values read in response to KVSReadRequests) |
eager_read_keys |
KVSKey set | Keys this transaction will read (send values read as soon as possible) |
will_write_keys |
KVSKey set | Keys this transaction will write. Future reads are dependent only on the KVSWrite for this TxFingerprint. |
may_write_keys |
KVSKey set | Keys this transaction may write. Future reads are dependent on the KVSWrite for this TxFingerprint, or, if that has a None , the previous value. |
curator |
ExternalIdentity | the Worker Engine in charge of the corresponding transactions |
executor |
ExternalIdentity | the Executor for this TransactionCandidate |
timestamp |
TxFingerprint | specifies the transaction affiliated with these locks. |
The lazy_read_keys
and eager_read_keys
may not overlap.
In the same way, will_write_keys
and may_write_keys
must be
disjoint.
There must be one KVSAcquireLock
per Shard
per TxFingerprint: for a given Shard and TxFingerprint,
all information is to be provided in totality or not at all.1
Note that future versions may use some kind of structured Key
s to
encode "Sets" containing infinitely many Key
s.
For V1, however, simple HashSets or similar are fine.
Effects¶
- The Shard stores the respective "locks" for all keys in its timeline.
- these are the "markers" described in Shard State.
- The
eager_read_keys
will be served as soon as possible (by sendingKVSRead
-messages to the executor). - The Shard immediately informs the curator that the locks are acquired, using a KVSLockAcquired message, so the curator can prepare UpdateSeenAll messages.
Triggers¶
- to Worker Engine: KVSLockAcquired send a KVSLockAcquired message to the curator, signaling that the locks of this message will be accounted for.
- to executor: KVSRead
for each
recordedeager_read_key
in this shard's timeline for which the most recent written value is established: send a KVSRead message to the Executor.
(Wiki) links on this page
- Worker Engine
- Executor
- KVSKey
- KVSReadRequest
- KVSKey
- KVSKey
- KVSWrite
- TxFingerprint
- KVSKey
- KVSWrite
- TxFingerprint
- Worker Engine
- Executor
- TransactionCandidate
- TxFingerprint
- Shard
- TxFingerprint
- Shard
- TxFingerprint
- Shard
- Shard
- Executor
- Shard
- Worker Engine
- KVSLockAcquired
- Worker Engine
- UpdateSeenAll
- Worker Engine
- KVSLockAcquired
- KVSLockAcquired
- Worker Engine
- Executor
- KVSRead
- KVSRead
- Executor
-
Note that transaction requests come with all this information at once for each transaction candidate. ↩