Skip to content

Commit

Permalink
remove sync in wal.WriteAll (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
akiozihao authored Sep 17, 2023
1 parent 108e185 commit 9ac16d0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ func (wal *WAL) rotateActiveSegment() error {
}

// WriteAll write wal.pendingWrites to WAL and then clear pendingWrites
// WriteAll will Not sync segment based on wal.options
func (wal *WAL) WriteAll() ([]*ChunkPosition, error) {
if len(wal.pendingWrites) == 0 {
return make([]*ChunkPosition, 0), nil
Expand All @@ -368,11 +369,6 @@ func (wal *WAL) WriteAll() ([]*ChunkPosition, error) {
return nil, err
}

// sync the active segment file to ensure the durability.
if err := wal.activeSegment.Sync(); err != nil {
return nil, err
}

return positions, nil
}

Expand Down

0 comments on commit 9ac16d0

Please sign in to comment.