Skip to content

Commit

Permalink
prepare slice id to flush data earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Apr 17, 2024
1 parent 41b93ee commit 74a983e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/vfs/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ func (s *sliceWriter) write(ctx meta.Context, off uint32, data []uint8) syscall.
logger.Warnf("write: chunk: %d off: %d %s", s.id, off, err)
return syscall.EIO
}
} else if int(off) <= f.w.blockSize {
go s.prepareID(ctx, false)
}
}
return 0
Expand Down Expand Up @@ -263,6 +261,7 @@ func (f *fileWriter) writeChunk(ctx meta.Context, indx uint32, off uint32, data
notify: utils.NewCond(&f.Mutex),
started: time.Now(),
}
go s.prepareID(meta.Background, false)
c.slices = append(c.slices, s)
if len(c.slices) == 1 {
f.w.Lock()
Expand Down

0 comments on commit 74a983e

Please sign in to comment.