@@ -2006,12 +2006,17 @@ an earlier decision here.
20062006- D9 retention, amended by review MEM-P06-A1-R1 F5 (recorded as asked in A1-R2 F8 (c)). D9 says
20072007 "Identity, revision, level and digest stay for provenance". As implemented, they stay while
20082008 anything references the source:
2009- - A source whose content was nulled 30 or more days ago, and that no link and no operation
2009+ - A source whose content was nulled more than 30 days ago, and that no link and no operation
20102010 names, is deleted (` remove_unreferenced_sources ` ,
2011- ` services/memory/src/adapters/postgres/retention.rs:541 ` ).
2012- - A finished operation that no observation names is deleted with its op-source rows 30 days
2013- after it finished (` remove_unreferenced_operations ` , same file, line 518). Both run from
2014- ` sweep_aged_once ` (line 405), each in its own transaction that re-checks its predicate.
2011+ ` services/memory/src/adapters/postgres/retention.rs:541 ` ). The candidates are locked
2012+ first, so a save citing one waits, and the delete re-checks the references in a fresh
2013+ snapshot.
2014+ - A finished operation that no observation names is deleted with its op-source rows more
2015+ than 30 days after it finished (` remove_unreferenced_operations ` , same file, line 518).
2016+ Its delete relies on the row lock taken with the candidates (` FOR UPDATE SKIP LOCKED ` )
2017+ rather than a re-check; an observation names its operation only from that operation's
2018+ own commit, before it finished.
2019+ - Both run from ` sweep_aged_once ` (line 405), each in its own transaction.
20152020 - Consequences:
20162021 - re-recording a removed revision creates a fresh source row, because revision immutability
20172022 holds only while something references the revision;
0 commit comments