Browse Source

volume: fix bug with 8000GB version if using in memory index

fix https://github.com/chrislusf/seaweedfs/issues/994
pull/997/head
Chris Lu 6 years ago
parent
commit
ec75b2d761
  1. 5
      weed/storage/needle_map/compact_map.go

5
weed/storage/needle_map/compact_map.go

@ -1,9 +1,10 @@
package needle_map package needle_map
import ( import (
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"sort" "sort"
"sync" "sync"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
) )
const ( const (
@ -81,7 +82,7 @@ func (cs *CompactSection) Set(key NeedleId, offset Offset, size uint32) (oldOffs
func (cs *CompactSection) setOverflowEntry(skey SectionalNeedleId, offset Offset, size uint32) { func (cs *CompactSection) setOverflowEntry(skey SectionalNeedleId, offset Offset, size uint32) {
needleValue := SectionalNeedleValue{Key: skey, OffsetLower: offset.OffsetLower, Size: size} needleValue := SectionalNeedleValue{Key: skey, OffsetLower: offset.OffsetLower, Size: size}
needleValueExtra := SectionalNeedleValueExtra{OffsetHigher: OffsetHigher{}} needleValueExtra := SectionalNeedleValueExtra{OffsetHigher: offset.OffsetHigher}
insertCandidate := sort.Search(len(cs.overflow), func(i int) bool { insertCandidate := sort.Search(len(cs.overflow), func(i int) bool {
return cs.overflow[i].Key >= needleValue.Key return cs.overflow[i].Key >= needleValue.Key
}) })

|||||||
100:0
Loading…
Cancel
Save