mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix wrong bool param in the getDistribution method (#21463)
Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
daa4492e95
commit
df6ccfa104
12
internal/querycoordv2/dist/dist_handler.go
vendored
12
internal/querycoordv2/dist/dist_handler.go
vendored
@ -68,8 +68,8 @@ func (dh *distHandler) start(ctx context.Context) {
|
||||
logger.Info("close dist handelr")
|
||||
return
|
||||
case <-ticker.C:
|
||||
dh.getDistribution(ctx, func(isSuccess bool) {
|
||||
if !isSuccess {
|
||||
dh.getDistribution(ctx, func(isFail bool) {
|
||||
if isFail {
|
||||
failures++
|
||||
node := dh.nodeManager.Get(dh.nodeID)
|
||||
if node != nil {
|
||||
@ -207,7 +207,7 @@ func (dh *distHandler) updateLeaderView(resp *querypb.GetDataDistributionRespons
|
||||
dh.dist.LeaderViewManager.Update(resp.GetNodeID(), updates...)
|
||||
}
|
||||
|
||||
func (dh *distHandler) getDistribution(ctx context.Context, fn func(isSuccess bool)) {
|
||||
func (dh *distHandler) getDistribution(ctx context.Context, fn func(isFail bool)) {
|
||||
dh.mu.Lock()
|
||||
defer dh.mu.Unlock()
|
||||
cctx, cancel := context.WithTimeout(ctx, distReqTimeout)
|
||||
@ -218,15 +218,15 @@ func (dh *distHandler) getDistribution(ctx context.Context, fn func(isSuccess bo
|
||||
})
|
||||
cancel()
|
||||
|
||||
isSuccess := err != nil || resp.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success
|
||||
if isSuccess {
|
||||
isFail := err != nil || resp.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success
|
||||
if isFail {
|
||||
dh.logFailureInfo(resp, err)
|
||||
} else {
|
||||
dh.handleDistResp(resp)
|
||||
}
|
||||
|
||||
if fn != nil {
|
||||
fn(isSuccess)
|
||||
fn(isFail)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user