We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a409c28 commit 7fd0b67Copy full SHA for 7fd0b67
src/value_log.rs
@@ -131,13 +131,21 @@ impl ValueLog {
131
let blob_cache = config.blob_cache.clone();
132
let manifest = SegmentManifest::recover(&path)?;
133
134
+ let highest_id = manifest
135
+ .segments
136
+ .read()
137
+ .expect("lock is poisoned")
138
+ .values()
139
+ .map(|x| x.id)
140
+ .max()
141
+ .unwrap_or_default();
142
+
143
Ok(Self(Arc::new(ValueLogInner {
144
config,
145
path,
146
blob_cache,
147
manifest,
- // TODO: recover ID, test!!!, maybe store next ID in manifest as u64
- id_generator: IdGenerator::default(),
148
+ id_generator: IdGenerator::new(highest_id + 1),
149
rollover_guard: Mutex::new(()),
150
})))
151
}
0 commit comments