Fix bug for setting index state when indexnode connecting failed (#28221)

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
pull/28267/head
cai.zhang 2023-11-07 23:34:26 +08:00 committed by GitHub
parent d0bea0eb0a
commit 304f232a02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -360,12 +360,12 @@ func (ib *indexBuilder) getTaskState(buildID, nodeID UniqueID) indexTaskState {
if err != nil {
log.Ctx(ib.ctx).Warn("IndexCoord get jobs info from IndexNode fail", zap.Int64("nodeID", nodeID),
zap.Error(err))
return indexTaskInProgress
return indexTaskRetry
}
if response.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success {
log.Ctx(ib.ctx).Warn("IndexCoord get jobs info from IndexNode fail", zap.Int64("nodeID", nodeID),
zap.Int64("buildID", buildID), zap.String("fail reason", response.GetStatus().GetReason()))
return indexTaskInProgress
return indexTaskRetry
}
// indexInfos length is always one.

View File

@ -930,7 +930,7 @@ func TestIndexBuilder_Error(t *testing.T) {
state, ok := ib.tasks[buildID]
assert.True(t, ok)
assert.Equal(t, indexTaskInProgress, state)
assert.Equal(t, indexTaskRetry, state)
})
t.Run("get state fail", func(t *testing.T) {
@ -955,7 +955,7 @@ func TestIndexBuilder_Error(t *testing.T) {
state, ok := ib.tasks[buildID]
assert.True(t, ok)
assert.Equal(t, indexTaskInProgress, state)
assert.Equal(t, indexTaskRetry, state)
})
t.Run("finish task fail", func(t *testing.T) {