Fix load index panic (#26457)

Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
pull/26404/head
Xiaofan 2023-08-21 09:56:20 +08:00 committed by GitHub
parent f2a6683a97
commit 7b3a1dc93f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 12 deletions

View File

@ -180,19 +180,14 @@ func (mgr *segmentManager) UpdateSegmentVersion(segmentType SegmentType, segment
mgr.mu.Lock()
defer mgr.mu.Unlock()
targetMap := mgr.growingSegments
switch segmentType {
case SegmentTypeGrowing:
targetMap = mgr.growingSegments
case SegmentTypeSealed:
targetMap = mgr.sealedSegments
default:
panic("unexpected segment type")
segment, ok := mgr.sealedSegments[segmentID]
if !ok {
segment, ok = mgr.growingSegments[segmentID]
}
segment, ok := targetMap[segmentID]
if !ok {
log.Warn("segment not exist, skip segment version change",
zap.Any("type", segmentType),
zap.Int64("segmentID", segmentID),
zap.Int64("newVersion", newVersion),
)
@ -202,13 +197,13 @@ func (mgr *segmentManager) UpdateSegmentVersion(segmentType SegmentType, segment
if segment.Version() >= newVersion {
log.Warn("Invalid segment version changed, skip it",
zap.Int64("segmentID", segment.ID()),
zap.Any("type", segmentType),
zap.Int64("oldVersion", segment.Version()),
zap.Int64("newVersion", newVersion))
return
}
segment.UpdateVersion(newVersion)
targetMap[segmentID] = segment
}
func (mgr *segmentManager) Get(segmentID UniqueID) Segment {

View File

@ -34,8 +34,8 @@ source ${ROOT_DIR}/scripts/setenv.sh
pushd ${BUILD_OUTPUT_DIR}
export CONAN_REVISIONS_ENABLED=1
export CXXFLAGS=-Wno-error=address
export CFLAGS=-Wno-error=address
export CXXFLAGS="-Wno-error=address -Wno-error=deprecated-declarations"
export CFLAGS="-Wno-error=address -Wno-error=deprecated-declarations"
if [[ ! `conan remote list` == *default-conan-local* ]]; then
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
fi