mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 15:03:32 +08:00
use memory chunks only for sequential writes
This commit is contained in:
@@ -94,7 +94,8 @@ func (up *UploadPipeline) SaveDataAt(p []byte, off int64, isSequential bool, tsN
|
|||||||
up.moveToSealed(up.writableChunks[candidateChunkIndex], candidateChunkIndex)
|
up.moveToSealed(up.writableChunks[candidateChunkIndex], candidateChunkIndex)
|
||||||
// fmt.Printf("flush chunk %d with %d bytes written\n", logicChunkIndex, oldestTs)
|
// fmt.Printf("flush chunk %d with %d bytes written\n", logicChunkIndex, oldestTs)
|
||||||
}
|
}
|
||||||
if len(up.writableChunks) < up.writableChunkLimit &&
|
if isSequential &&
|
||||||
|
len(up.writableChunks) < up.writableChunkLimit &&
|
||||||
atomic.LoadInt64(&memChunkCounter) < 4*int64(up.writableChunkLimit) {
|
atomic.LoadInt64(&memChunkCounter) < 4*int64(up.writableChunkLimit) {
|
||||||
pageChunk = NewMemChunk(logicChunkIndex, up.ChunkSize)
|
pageChunk = NewMemChunk(logicChunkIndex, up.ChunkSize)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user