MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / compact_commit

Method compact_commit

nodedb/src/engine/sparse/fts_redb/backend/core.rs:77–93  ·  view source on GitHub ↗

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],
    )

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

compact_commitFunction · 0.85

Tested by

no test coverage detected