mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-19 15:03:41 +08:00
ensure section.chunks is always garbage free
This commit is contained in:
parent
75bdd4a0d1
commit
e650c8397d
@ -30,7 +30,9 @@ func (section *FileChunkSection) addChunk(chunk *filer_pb.FileChunk) error {
|
|||||||
|
|
||||||
section.chunks = append(section.chunks, chunk)
|
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)
|
MergeIntoVisibles(section.visibleIntervals, start, stop, chunk)
|
||||||
garbageFileIds := FindGarbageChunks(section.visibleIntervals, start, stop)
|
garbageFileIds := FindGarbageChunks(section.visibleIntervals, start, stop)
|
||||||
removeGarbageChunks(section, garbageFileIds)
|
removeGarbageChunks(section, garbageFileIds)
|
||||||
|
Loading…
Reference in New Issue
Block a user