Skip to content

Commit 7b3a1dc

Browse files
authored
Fix load index panic (milvus-io#26457)
Signed-off-by: xiaofan-luan <[email protected]>
1 parent f2a6683 commit 7b3a1dc

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

internal/querynodev2/segments/manager.go

+5-10
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,14 @@ func (mgr *segmentManager) UpdateSegmentVersion(segmentType SegmentType, segment
180180
mgr.mu.Lock()
181181
defer mgr.mu.Unlock()
182182

183-
targetMap := mgr.growingSegments
184-
switch segmentType {
185-
case SegmentTypeGrowing:
186-
targetMap = mgr.growingSegments
187-
case SegmentTypeSealed:
188-
targetMap = mgr.sealedSegments
189-
default:
190-
panic("unexpected segment type")
183+
segment, ok := mgr.sealedSegments[segmentID]
184+
if !ok {
185+
segment, ok = mgr.growingSegments[segmentID]
191186
}
192187

193-
segment, ok := targetMap[segmentID]
194188
if !ok {
195189
log.Warn("segment not exist, skip segment version change",
190+
zap.Any("type", segmentType),
196191
zap.Int64("segmentID", segmentID),
197192
zap.Int64("newVersion", newVersion),
198193
)
@@ -202,13 +197,13 @@ func (mgr *segmentManager) UpdateSegmentVersion(segmentType SegmentType, segment
202197
if segment.Version() >= newVersion {
203198
log.Warn("Invalid segment version changed, skip it",
204199
zap.Int64("segmentID", segment.ID()),
200+
zap.Any("type", segmentType),
205201
zap.Int64("oldVersion", segment.Version()),
206202
zap.Int64("newVersion", newVersion))
207203
return
208204
}
209205

210206
segment.UpdateVersion(newVersion)
211-
targetMap[segmentID] = segment
212207
}
213208

214209
func (mgr *segmentManager) Get(segmentID UniqueID) Segment {

scripts/3rdparty_build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ source ${ROOT_DIR}/scripts/setenv.sh
3434
pushd ${BUILD_OUTPUT_DIR}
3535

3636
export CONAN_REVISIONS_ENABLED=1
37-
export CXXFLAGS=-Wno-error=address
38-
export CFLAGS=-Wno-error=address
37+
export CXXFLAGS="-Wno-error=address -Wno-error=deprecated-declarations"
38+
export CFLAGS="-Wno-error=address -Wno-error=deprecated-declarations"
3939
if [[ ! `conan remote list` == *default-conan-local* ]]; then
4040
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
4141
fi

0 commit comments

Comments
 (0)