From 313fd17ae436182e4d89f6c76c2640a4d6bebd24 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 13 Jan 2023 20:32:18 -0800 Subject: [PATCH] allow random writes for mem chunk --- weed/mount/page_writer/upload_pipeline.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/weed/mount/page_writer/upload_pipeline.go b/weed/mount/page_writer/upload_pipeline.go index e1aa43fe2..f326445a3 100644 --- a/weed/mount/page_writer/upload_pipeline.go +++ b/weed/mount/page_writer/upload_pipeline.go @@ -94,8 +94,7 @@ func (up *UploadPipeline) SaveDataAt(p []byte, off int64, isSequential bool, tsN up.moveToSealed(up.writableChunks[candidateChunkIndex], candidateChunkIndex) // fmt.Printf("flush chunk %d with %d bytes written\n", logicChunkIndex, oldestTs) } - if isSequential && - len(up.writableChunks) < up.writableChunkLimit && + if len(up.writableChunks) < up.writableChunkLimit && atomic.LoadInt64(&memChunkCounter) < 4*int64(up.writableChunkLimit) { pageChunk = NewMemChunk(logicChunkIndex, up.ChunkSize) } else {