添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

3个节点从Nacos 1.3.2升级到Nacos 2.0.1,按照升级文档操作后,3个节点都持续打印 upgrade check result false

定位到完成Check工作的类是 com.alibaba.nacos.naming.core.v2.upgrade.UpgradeJudgement 类,改造了 checkServiceAndInstanceNumber 方法打印Check工作的现场信息。

改造后 checkServiceAndInstanceNumber 方法如下:

private boolean checkServiceAndInstanceNumber() {
        boolean result = serviceManager.getServiceCount() == MetricsMonitor.getDomCountMonitor().get();
        result &= serviceManager.getInstanceCount() == MetricsMonitor.getIpCountMonitor().get();
        Loggers.SRV_LOG.error("TAG: ServiceCount-{}-{}, InstanceCount-{}-{}", serviceManager.getServiceCount(),
            MetricsMonitor.getDomCountMonitor().get(), serviceManager.getInstanceCount(),
            MetricsMonitor.getIpCountMonitor().get());
        return result;

基于改造后的JAR包运行后,发现日志如下:

2021-05-10 14:33:50,785 ERROR TAG: ServiceCount-0-0, InstanceCount-0-0
2021-05-10 14:33:55,775 ERROR TAG: ServiceCount-38-0, InstanceCount-251-251
2021-05-10 14:34:00,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-251
2021-05-10 14:34:05,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-251
2021-05-10 14:34:10,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-251
2021-05-10 14:34:15,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-251
2021-05-10 14:34:20,776 ERROR TAG: ServiceCount-38-38, InstanceCount-251-251
2021-05-10 14:34:25,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-219
2021-05-10 14:34:30,776 ERROR TAG: ServiceCount-38-38, InstanceCount-251-182
2021-05-10 14:34:35,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-182
2021-05-10 14:34:40,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-182
2021-05-10 14:34:45,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-182
2021-05-10 14:34:50,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-182
2021-05-10 14:34:55,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-214
2021-05-10 14:35:00,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-214
2021-05-10 14:35:05,774 ERROR TAG: ServiceCount-38-38, InstanceCount-251-214

也就是说通不过Check的原因是serviceManager.getInstanceCount() == MetricsMonitor.getIpCountMonitor().get()持续返回false.

问题1:请问如何解决以上问题?

问题2:另外,还有1个困惑:假如当前升级成功+关闭双写后,下次重启一个节点是否仍然会做以上检查,如果彼时检查通不过,会不会产生数据一致性问题,而不能正常工作?