Fix wrong meta when balance's watchQueryChannel task failed (#14235)

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/14248/head
xige-16 2021-12-25 23:12:50 +08:00 committed by GitHub
parent 4be6a442e8
commit 8e2e9c3735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -644,7 +644,13 @@ func (scheduler *TaskScheduler) scheduleLoop() {
if triggerTask.getResultInfo().ErrorCode == commonpb.ErrorCode_Success {
processInternalTaskFn(lowPriorityTasks, triggerTask)
}
if triggerTask.getResultInfo().ErrorCode == commonpb.ErrorCode_Success {
//TODO::xige-16, judging the triggerCondition is ugly, the taskScheduler will be refactored soon
// if query node down, the loaded segment and watched dmChannel by the node should be balance to new querynode
// if triggerCondition == NodeDown, loadSegment and watchDmchannel request will keep reschedule until the success
// the node info has been deleted after assgining child task to triggerTask
// so it is necessary to update the meta of segment and dmchannel, or some data may be lost in meta
if triggerTask.getResultInfo().ErrorCode == commonpb.ErrorCode_Success || triggerTask.getTriggerCondition() == querypb.TriggerCondition_NodeDown {
err = updateSegmentInfoFromTask(scheduler.ctx, triggerTask, scheduler.meta)
if err != nil {
triggerTask.setResultInfo(err)