Browse Source

memchunk save content twice (#4174)

pull/4177/head
wusong 2 years ago
committed by GitHub
parent
commit
fe573f26a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      weed/mount/page_writer/page_chunk_mem.go

10
weed/mount/page_writer/page_chunk_mem.go

@ -1,10 +1,11 @@
package page_writer
import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/mem"
"sync"
"sync/atomic"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/mem"
)
var (
@ -100,11 +101,6 @@ func (mc *MemChunk) SaveContent(saveFn SaveToStorageFunc) {
if saveFn == nil {
return
}
for t := mc.usage.head.next; t != mc.usage.tail; t = t.next {
reader := util.NewBytesReader(mc.buf[t.StartOffset:t.stopOffset])
saveFn(reader, int64(mc.logicChunkIndex)*mc.chunkSize+t.StartOffset, t.Size(), t.TsNs, func() {
})
}
for t := mc.usage.head.next; t != mc.usage.tail; t = t.next {
startOffset := t.StartOffset

Loading…
Cancel
Save