Skip to content

Commit

Permalink
Update src/file_pipe_log/pipe.rs
Browse files Browse the repository at this point in the history
Co-authored-by: lucasliang <[email protected]>
  • Loading branch information
v01dstar and LykxSassinator authored Nov 7, 2023
1 parent 34db5d0 commit 409ab3a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/file_pipe_log/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,16 @@ impl<F: FileSystem> SinglePipe<F> {
fail_point!("file_pipe_log::append");
let mut writable_file = self.writable_file.lock();
if writable_file.writer.offset() >= self.target_file_size {
self.rotate_imp(&mut writable_file)?;
if let Err(e) = self.rotate_imp(&mut writable_file) {
// As the disk is already full and is no valid and extra directory to flush data, it can safely return the `no space err` to users.
if is_no_space_err(&e) && self.paths.len() == 1 {
return Err(e);
}
panic!(
"error when rotate [{:?}:{}]: {e}",
self.queue, writable_file.seq,
);
}
}

let seq = writable_file.seq;
Expand Down

0 comments on commit 409ab3a

Please sign in to comment.