symfonic.memory.backends.postgres_claimed_discard¶
postgres_claimed_discard ¶
Set-based discard of claimed native pending rows, inside one transaction.
Reproduces _native_cascade(claim_token=...) applied row by row in the
given order. Nodes and their incident edges are locked in chunked statements;
the per-node checks then run in Python in the original order, so a single
failing check raises the same error. When several coincide, such as a lock
wait and a budget overflow, another may surface first; nothing commits either
way. An edge is deleted iff the row-at-a-time cascade
would have deleted it: the earliest discarded endpoint whose owner rule admits
it takes it, and later endpoints no longer see it, either for eligibility or
for their incident-edge budget. A node whose locked page was truncated after
an earlier deletion re-reads exactly the page the sequential query would see.
The whole transaction runs as index probes, and the claim-generation delete
requires the operator-installed record index, so no statement reads history.
discard_claimed
async
¶
discard_claimed(pool: Any, tenant_id: str, owned: list[tuple[Any, str, str]], edge_upsert_mode: str) -> None
Discard (storage scope, node id, token) of one tenant, or none of them.