Atomically write a new merged FTS segment and remove the source segments. All mutations run in a single redb write transaction so the operation is crash-safe: a crash mid-compaction leaves the original segments intact and the maintenance cycle retries on the next pass.
(
&self,
tid: u64,
collection: &str,
new_segment_id: &str,
new_segment_data: &[u8],
merged_ids: &[String],
)
| 75 | /// is crash-safe: a crash mid-compaction leaves the original segments |
| 76 | /// intact and the maintenance cycle retries on the next pass. |
| 77 | pub fn compact_commit( |
| 78 | &self, |
| 79 | tid: u64, |
| 80 | collection: &str, |
| 81 | new_segment_id: &str, |
| 82 | new_segment_data: &[u8], |
| 83 | merged_ids: &[String], |
| 84 | ) -> crate::Result<()> { |
| 85 | super::segments::compact_commit( |
| 86 | self, |
| 87 | tid, |
| 88 | collection, |
| 89 | new_segment_id, |
| 90 | new_segment_data, |
| 91 | merged_ids, |
| 92 | ) |
| 93 | } |
| 94 | |
| 95 | /// Enumerate all `(tid, collection)` pairs that have at least one FTS |
| 96 | /// segment. Used by maintenance to discover compaction candidates without |
nothing calls this directly
no test coverage detected