From 1e7205fa03f14098dcb02e48fa78f7ce230657c5 Mon Sep 17 00:00:00 2001 From: xige-16 Date: Fri, 7 May 2021 12:03:53 +0800 Subject: [PATCH] fix querynode's port not set correctly when conflict with other node (#5066) Signed-off-by: xige-16 --- internal/distributed/querynode/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/distributed/querynode/service.go b/internal/distributed/querynode/service.go index 467c437125..c768dfc919 100644 --- a/internal/distributed/querynode/service.go +++ b/internal/distributed/querynode/service.go @@ -215,7 +215,7 @@ func (s *Server) startGrpcLoop(grpcPort int) { addr := ":" + strconv.Itoa(grpcPort) lis, err = net.Listen("tcp", addr) if err == nil { - Params.QueryNodePort = lis.Addr().(*net.TCPAddr).Port + qn.Params.QueryNodePort = int64(lis.Addr().(*net.TCPAddr).Port) } else { // set port=0 to get next available port grpcPort = 0