We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6473e6d commit 698bbefCopy full SHA for 698bbef
1 file changed
crates/commitlog/src/repo/mod.rs
@@ -289,6 +289,12 @@ pub fn resume_segment_writer<R: Repo>(
289
max_commit: _,
290
} = meta;
291
let mut writer = repo.open_segment_writer(offset)?;
292
+ // Ensure we have enough space for this segment.
293
+ // The segment could have been created without the `fallocate` feature
294
+ // enabled, so we call this here again to ensure writes can't fail due
295
+ // to ENOSPC.
296
+ fallocate(&mut writer, &opts)?;
297
+ // We use `O_APPEND`, but make the file offset consistent regardless.
298
writer.seek(io::SeekFrom::End(0))?;
299
300
Ok(Ok(Writer {
0 commit comments