Skip to content

Commit 9ac16d0

Browse files
authored
remove sync in wal.WriteAll (#31)
1 parent 108e185 commit 9ac16d0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

wal.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ func (wal *WAL) rotateActiveSegment() error {
344344
}
345345

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

371-
// sync the active segment file to ensure the durability.
372-
if err := wal.activeSegment.Sync(); err != nil {
373-
return nil, err
374-
}
375-
376372
return positions, nil
377373
}
378374

0 commit comments

Comments
 (0)