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
Implement revert() as a runtime-level primitive in addition to insert and handleAction. This is a low-level primitive that can be called by a runtime consumer through a hook, that reverts the effects of a past signed message.
This isn't a gossiplog-level primitive because it doesn't do any branch tracking, all it does is process $effects and model tables to revert the effects of an action. Its effects are exclusively at the level above the sync topology / causal log topology.
It can only be called for actions.
For testing, override execute to provide a db.revert()
Update handleAction to add a new db.revert(id) operation (temporarily) to test.
Add locking to the database and update handleAction to add locking.
If an action calls db.lock() which can only be called at the beginning of the function, then any effects written after it are isolated to the action message ID and any later operation that reverts the action message ID should also revert the effects.
If an isolated action reads from any effects that contain a lock, then it should inherit that lock. Reads are deterministic because db.get() searches the causal log, so we don't need to worry about consistency issues here.
If an isolated or non-isolated action merges with past effects and any of them was isolated under a lock, then the merged effect should inherit its lock(s).
$locks table includes the columns key, action, lock with indexes on each field
$effects table schema is unchanged with columns key, value, branch, clock
The text was updated successfully, but these errors were encountered:
raykyri
changed the title
packages/core: Snapshot isolation, lock and revert
packages/core: Snapshot isolation, db.lock() and revert
Nov 6, 2024
raykyri
changed the title
packages/core: Snapshot isolation, db.lock() and revert
packages/core: Snapshot isolation, db.lock() and revert()
Nov 8, 2024
raykyri
changed the title
packages/core: Snapshot isolation, db.lock() and revert()
spec: Snapshot isolation, db.lock() and revert()
Nov 26, 2024
insert
andhandleAction
. This is a low-level primitive that can be called by a runtime consumer through a hook, that reverts the effects of a past signed message.handleAction
to add a new db.revert(id) operation (temporarily) to test.handleAction
to add locking.lock
, then the merged effect should inherit its lock(s).key, action, lock
with indexes on each fieldkey, value, branch, clock
The text was updated successfully, but these errors were encountered: