One-time compatibility rebuild from persisted canonical effects and committed view logs. A registered/fetched object by itself is not evidence. The marker and recovered entries commit together, so an interrupted rebuild retries. No path ownership or recorded content is inferred from this index.
(txn: &redb::WriteTransaction)
| 18 | /// The marker and recovered entries commit together, so an interrupted rebuild |
| 19 | /// retries. No path ownership or recorded content is inferred from this index. |
| 20 | pub(crate) fn initialize(txn: &redb::WriteTransaction) -> PristineResult<()> { |
| 21 | let mut index = txn.open_table(APPLIED_CHANGES)?; |
| 22 | let mut meta = txn.open_table(PRISTINE_META)?; |
| 23 | if meta.get(INDEX_VERSION_KEY)?.is_some() { |
| 24 | return Ok(()); |
| 25 | } |
| 26 | for id in canonical_effect_writers( |
| 27 | &txn.open_multimap_table(GRAPH)?, |
| 28 | &txn.open_multimap_table(POSITION_ATTRS)?, |
| 29 | &txn.open_table(VIEW_CHANGES)?, |
| 30 | )? { |
| 31 | index.insert(id, 1)?; |
| 32 | } |
| 33 | meta.insert(INDEX_VERSION_KEY, 1)?; |
| 34 | Ok(()) |
| 35 | } |
| 36 | |
| 37 | fn canonical_effect_writers( |
| 38 | graph: &impl ReadableMultimapTable<&'static [u8; 24], &'static [u8; 24]>, |
no test coverage detected