You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 ISSUE #14016 ,Hi~ o( ̄▽ ̄)ブ @KomachiSion ,有时间请帮忙 review
问题的原因是 Console 服务 cluster.conf 配置文件中的 Nacos Server 节点下线后 Console 无法感知,导致 Console 在进行导入或导出时将请求发送到了已经 Down 的节点,如果想解决问题只需将请求发送给正常在线的节点即可。
先说我改动的点:将
ConfigImportAndExportService中randomOneMember随机获取一个节点的方法改成了randomOneHealthyMember随机获取一个在线的节点,判断是否在线的方法是借助RemoteClusterHandler先获取到了 Nacos Server 中当前所有节点的状态,并将 Console 本机配置的 cluster.conf 下线的节点移除,那么这样就只剩下了在线的节点,随机选择一个节点发送请求理论上就不会再出现问题。这么改的原因是:
RemoteServerMemberManager添加RemoteClusterHandler的查询逻辑获取节点状态,但是发现会触发 Bean 的循环引用,所以不能这么做RemoteServerMemberManager#allMembers方法的地方很多,所以这个方法我不敢轻易修改,那么想通过RemoteServerMemberManager来获取健康的节点信息就需要添加一个新的方法,如果这个新的方法只给ConfigImportAndExportService用的话,我觉得本次改动还不如在ConfigImportAndExportService改动来得方便ClientHttpProxy#executeSyncHttpRequest方法,这个方法中是有失败重试的,但是我猜测当初设计导入导出功能没走这个方法应该考虑了导入导出功能的特殊性:大数据量的导入导出请求耗时长且会占用大量服务器内存资源,自主重试容易产生性能问题,所以才没有选择走ClientHttpProxy#executeSyncHttpRequest方法。那么从这点考虑,在ConfigImportAndExportService的添加 ”在发送请求前判断节点的状态并选择合适的节点的逻辑“ 也合理