Closed gougousha closed 11 months ago
问题:集群环境下,发现不同机器 func (p *defaultProducer) UpdateTopicPublishInfo函数存储同一个topic的Mqlist顺序不一致 eg: 机器A topic为test的Mqlist是 broke-a, broke-b, broke-a 机器B topic为test的Mqlist是 broke-b, broke-a, broke-c
原因分析: UpdateTopicRouteInfoWithDefault 函数返回的TopicRouteData. OrderTopicConf 字段不一致 。 可能需要查看内部queryTopicRouteInfoFromServer函数同一个topic返回的为啥不一致
解决方案:目前处理方式是在存储mqlist信息前进行排序
sort.Slice(info.MqList, func(i, j int) bool { if info.MqList[i].BrokerName != info.MqList[j].BrokerName { return strings.Compare(info.MqList[i].BrokerName, info.MqList[j].BrokerName) < 0 } return info.MqList[i].QueueId < info.MqList[j].QueueId })
see #1077
问题:集群环境下,发现不同机器 func (p *defaultProducer) UpdateTopicPublishInfo函数存储同一个topic的Mqlist顺序不一致 eg: 机器A topic为test的Mqlist是 broke-a, broke-b, broke-a 机器B topic为test的Mqlist是 broke-b, broke-a, broke-c
原因分析: UpdateTopicRouteInfoWithDefault 函数返回的TopicRouteData. OrderTopicConf 字段不一致 。 可能需要查看内部queryTopicRouteInfoFromServer函数同一个topic返回的为啥不一致
解决方案:目前处理方式是在存储mqlist信息前进行排序