Browse Source

ensure section.chunks is always garbage free

pull/3942/merge
chrislu 2 years ago
parent
commit
e650c8397d
  1. 4
      weed/filer/filechunk_section.go

4
weed/filer/filechunk_section.go

@ -30,7 +30,9 @@ func (section *FileChunkSection) addChunk(chunk *filer_pb.FileChunk) error {
section.chunks = append(section.chunks, chunk)
if section.visibleIntervals != nil {
if section.visibleIntervals == nil {
section.visibleIntervals = readResolvedChunks(section.chunks, int64(section.sectionIndex)*SectionSize, (int64(section.sectionIndex)+1)*SectionSize)
} else {
MergeIntoVisibles(section.visibleIntervals, start, stop, chunk)
garbageFileIds := FindGarbageChunks(section.visibleIntervals, start, stop)
removeGarbageChunks(section, garbageFileIds)

Loading…
Cancel
Save