From 149343e5aff7f49e5a50750019f47a68fd8808ea Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Wed, 17 Apr 2024 17:14:19 +0800 Subject: [PATCH] vfs: prepare slice id to flush data earlier (#4721) --- pkg/vfs/writer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/vfs/writer.go b/pkg/vfs/writer.go index ba7955dfa9e7..439ae8ddcec9 100644 --- a/pkg/vfs/writer.go +++ b/pkg/vfs/writer.go @@ -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 @@ -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()