symfonic.memory.backends.postgres_pending_claims¶
postgres_pending_claims ¶
Durable identity for private native PostgreSQL pending writes.
An accepted token survives publication in this ledger. A later retry may therefore prove its own earlier commit even after pending row markers vanish. Unclaimed pre-v11 rows are deliberately not adopted by guessing from an ID.
erase_subtree
async
¶
Forget all claim identities in the graph sweep's same transaction.
Published generations stay in the ledger, so a subtree's claims grow with rewrites while its live rows do not. Read at most budget+1 tokens through the owner C index as index probes and refuse above the budget; the caller's transaction then rolls the whole forget back. Every native claim insert follows its node upsert in one transaction, so the sweep's EXCLUSIVE node lock closes this set; a claim still found after the token delete refuses rather than survive a forget reported complete. The delete must remove every token read, each still inside the owner range: a claim moved or removed by another writer in between refuses, and the rollback restores a moved claim where that writer put it.
The budget counts visible claims. Dead index entries of erased claims are still visited until vacuum removes them, and only the forget deadline bounds that read.
Source code in src/symfonic/memory/backends/postgres_pending_claims.py
over_budget
async
¶
Whether the subtree holds more claims than one forget may erase inline.
Asked before any delete, under the sweep's EXCLUSIVE node lock, so a forget that must become a durable job refuses or hands off before it mutates anything. The read stops at budget+1 claims.
Source code in src/symfonic/memory/backends/postgres_pending_claims.py
publish_node
async
¶
Publish only the exact pending version and mark its claim atomically.
Source code in src/symfonic/memory/backends/postgres_pending_claims.py
state_of
async
¶
A claim under an erasing subtree refuses rather than read as any state.
Source code in src/symfonic/memory/backends/postgres_pending_claims.py
states
async
¶
Return only IDs whose exact owner and token were published.