Browse Source

fixed ClusterAdmin DescribeCluster api return controllerID invalid #1511

antsbean 6 năm trước cách đây
mục cha
commit
7465d6b37e
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      admin.go

+ 4 - 0
admin.go

@@ -214,6 +214,10 @@ func (ca *clusterAdmin) DescribeCluster() (brokers []*Broker, controllerID int32
 		Topics: []string{},
 	}
 
+	if ca.conf.Version.IsAtLeast(V0_11_0_0) {
+		request.Version = 1
+	}
+
 	response, err := controller.GetMetadata(request)
 	if err != nil {
 		return nil, int32(0), err