symfonic.memory.backends.postgres_erase_routing¶
postgres_erase_routing ¶
Decide, before any delete, whether a native forget needs the eraser (CORE-199 S2).
The runtime's own forget transaction asks this under the sweep's EXCLUSIVE graph lock and mutates nothing when the answer is yes. Three conditions hand the forget to the eraser principal:
- an erasing job overlaps the subtree: the identical prefix resumes it, an ancestor or descendant refuses there. The runtime must not erase those claims inline, since it cannot lift the job that fences them.
- the claim history exceeds what one transaction may erase.
- the content exceeds what one transaction may erase, once content jobs are
installed (
route_content, from the inline erase's own bounded reads).
Without the job table (S1 not migrated) no job can exist, and an oversized
history refuses as it always did, now before the content delete rather than
after it. Without the generation table every native forget refuses
UNMIGRATED here, before either answer (CORE-171).
LargeEraseRequired ¶
Bases: MemoryContractError
A forget the runtime may not finish; nothing has been mutated.
Subclasses the refusal so that any caller other than the forget bridge
sees exactly the refusal it saw before S2. binding names the
memory_nodes relation the runtime routed against; the eraser refuses
to act on any other.
Source code in src/symfonic/memory/backends/postgres_erase_routing.py
overlap_sql ¶
Erasing jobs at an ancestor key, the key itself, or any descendant.
Source code in src/symfonic/memory/backends/postgres_erase_routing.py
route_content
async
¶
Hand an oversized content forget to the eraser once content jobs exist.
error is the inline erase's refusal, raised by its bounded reads
before any delete. Without content jobs it stands, as it always did.
Source code in src/symfonic/memory/backends/postgres_erase_routing.py
route_forget
async
¶
Raise LargeEraseRequired, or return to let the runtime erase inline.