Global store — current state¶
Version: 0.3 · Last Updated: 2026-09-08 · Status: 🔴 DA REVISIONARE
Verified against develop baseline 2465fcc. The September dictionary/lease
semantics below remain in force; issue #72 is not assumed implemented.
2026-08-22: the replica-era seams (snapshot/load_snapshot, /global/* paths) were removed (a79449e); a site restore does NOT restore the global store.
2026-09-08 (issue #74): the master is one dict[str, Any] on the commander — SpaCommander.global_register, built by new_global_store — with literal string keys and opaque values. Built:
GlobalStoreLockon the commander: oneasyncio.Lockplusholder,holder_workerandholder_key. Every operation waits on it, reads of other keys included.GlobalStoreOperationson the commander's dispatcher:/commander/store/{get,set,del,lock,unlock}.getanswersexistsbesidevalue. A non-string key raisesTypeError.SpaWorker.global_store, aGlobalStoreClient:get,set,delete,for_update.GlobalStoreLease, the turn:withorasync with, yielding itself withvalueandexists, plusabort(). The exit sends the COMPLETE value withapply=True; the commander replaces the selected key, or the whole dictionary when no key was selected. A body that raises, a grant that does not decode, a value that does not encode and an aborted turn release withapply=False.GlobalStoreCommitUnconfirmed: the commit left and the wire failed before the reply. Nothing is retried.- The death protocol:
WorkerHandler.on_child_lostcallsGlobalStoreOperations.release_worker_lock, which frees only that worker's turn and applies nothing. No lease timer, no expiry.
Removed in the same change: the master Bag, the worker-side store_get/store_set/store_del, the read that took no lock, CapturingGlobalStore, the change batch on the release and apply_global_store_changes. Operations on the store are by key, never by path.
Claim anchors: SpaCommander, new_global_store, GlobalStoreLock, GlobalStoreOperations, GlobalStoreClient, for_update, GlobalStoreLease, abort, GlobalStoreCommitUnconfirmed, WorkerHandler.
Source and test evidence¶
- Global store client and lease
- Commander store operations
- Worker death cleanup
- Dictionary and lease contracts
- Client contracts
Simple client get/set/delete calls run from a worker pool thread; leases also
support async with. Nested access from the context holding a lease is refused.
A stored None remains distinct from an absent key. Whole-store publication
uses clear/update under the one lock; keyed publication replaces one value.
A TYTX-looking string can collide with the codec, an explicitly retained limit.