Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

控制台中订阅者列表数据,多次查询的结果不一致 #5078

Closed
wanghuigithub opened this issue Mar 11, 2021 · 6 comments · Fixed by #5424
Closed

控制台中订阅者列表数据,多次查询的结果不一致 #5078

wanghuigithub opened this issue Mar 11, 2021 · 6 comments · Fixed by #5424
Labels
kind/bug Category issues or prs related to bug.
Milestone

Comments

@wanghuigithub
Copy link

nacos版本:1.4.0

问题描述:在控制台中查询服务订阅者。多次查询的结果不一致。查询期间订阅者一直存在,没有停止。
有时可以查到订阅者,有时查不到。但是更改实例信息时,订阅者的事件是可以接到通知的。

以往的issue中有两个相同的问题,但是没有说明原因,所以又开了一个issue

@KomachiSion
Copy link
Collaborator

issue描述不清,你的部署结构是怎样的? 是一直查询同一台nacos服务还是挂了域名和vip,会随机查询不同的nacos服务。

建议先测试一下是不是同一台nacos查询的结果就是变化的,并且订阅者没有一直在变更。

@wanghuigithub
Copy link
Author

wanghuigithub commented Mar 12, 2021

issue描述不清,你的部署结构是怎样的? 是一直查询同一台nacos服务还是挂了域名和vip,会随机查询不同的nacos服务。

建议先测试一下是不是同一台nacos查询的结果就是变化的,并且订阅者没有一直在变更。

是有VIP的。 订阅者是没有变更的,期间订阅者一直可以收到事件通知。

看了下查询订阅者列表的接口的逻辑。是会去集群中的其他节点获取其他节点上的订阅者的。
所以即使随机查询不同的nacos服务,也是不影响查询结果的。

测试现象补充:
访问vip没有数据。直连访问其中一个节点(一共5个节点)有数据
访问vip也不是一直没有数据,有时会有,有时没有

可以访问到数据的节点也是不稳定的,一段时间后,该节点又没有返回数据

问题排查补充:
com.alibaba.nacos.naming.core.SubscribeManager中100行,去集群中其他节点获取订阅者数据。
arthas抓取返回结果。如下图:
image

因为service/subscribers接口要求pageNo pageSize必传,但是com.alibaba.nacos.naming.core.SubscribeManager中在发起请求时,没有传pageNo pageSize。
com.alibaba.nacos.naming.core.SubscribeManager 91行

@KomachiSion
Copy link
Collaborator

能否升级之后再试一下?

@wanghuigithub
Copy link
Author

能否升级之后再试一下?

看了下1.4.1的代码,有问题的部分和1.4.0的代码是一致的,没有变动

@KomachiSion KomachiSion added kind/bug Category issues or prs related to bug. and removed status/need feedback labels Mar 12, 2021
@KomachiSion KomachiSion added this to the 1.4.2 milestone Mar 12, 2021
@wanghuigithub
Copy link
Author

wanghuigithub commented Mar 12, 2021

image

补充一下:
这里只处理的result是OK的情况。
result不OK时,打印错误日志是不是比较好。

@brotherlu-xcq
Copy link
Collaborator

I will try to sovle this issue.

KomachiSion pushed a commit that referenced this issue Apr 23, 2021
…ribers in other server node. (#5424)

* hardcode to get all the subscribers by set the pageSize to 10000

* change the default pageSize from 10000 to 1000

* change the param of getSubscriber to support the pageNo and pageSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
3 participants