Skip to content

Commit

Permalink
fixup!: update size after write is successful
Browse files Browse the repository at this point in the history
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
  • Loading branch information
bsbds authored and Phoenix500526 committed May 9, 2024
1 parent e40a269 commit 4eed780
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/curp/src/server/storage/wal/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ impl WALSegment {
{
let encoded_bytes = encoder.encode(item)?;
self.file.write_all(&encoded_bytes)?;
self.update_size(encoded_bytes.len().numeric_cast());
self.file.flush()?;
self.file.sync_data()?;
self.update_size(encoded_bytes.len().numeric_cast());

Ok(())
}
Expand Down

0 comments on commit 4eed780

Please sign in to comment.