fix: Remove beta table & migrate to gray
What does this PR do?
This PR fixes issue #13538 by restoring the config_info_beta table definition in mysql-schema.sql. This prevents false error logs reporting "master db xxx.xxx.xxx.xxx down" when the table is queried but doesn't exist.
Why are we doing this?
In Nacos 2.5.1, the config_info_beta table was removed from the MySQL schema, but some service implementations like ExternalConfigInfoBetaPersistServiceImpl still attempt to access it. This causes error logs in nacos-persistence.log even though the database is actually working fine.
How to test this PR?
- Initialize MySQL with the updated schema file
- Start Nacos configured to use the external MySQL
- Verify no errors like "master db xxx.xxx.xxx.xxx down" appear in the logs
Special notes for reviewer
This is a temporary solution. A more thorough fix would be to update all database health checks to consistently use config_info_gray instead of config_info_beta. I plan to address this in a follow-up PR.
修复config_info_beta表缺失导致的错误日志问题
变更概述
问题修复
- 受影响组件:
mysql-schema.sql数据库表结构 - 修复内容: 恢复
config_info_beta表定义并修正config_info_gray表字段顺序 - 技术细节:
- 在
mysql-schema.sql中新增config_info_beta表创建语句(包含id、data_id、group_id等字段) - 调整
config_info_gray表字段定义顺序,将tenant_id和app_name字段移至内容字段之前 - 修正
config_info_gray表唯一索引为uk_configinfogray_datagrouptenant(原为包含gray_name的复合索引)
- 在
- 修复目的: 解决因表缺失导致的"master db down"错误日志误报问题
变更文件
| 文件路径 | 变更说明 |
|---|---|
| distribution/conf/mysql-schema.sql | 新增config_info_beta表定义并调整config_info_gray表结构 |
时序图
sequenceDiagram
participant NacosServer
participant MySQL
NacosServer->>MySQL: 执行健康检查查询
MySQL-->>NacosServer: 返回config_info_beta表存在响应
NacosServer->>NacosServer: 停止生成数据库连接错误日志
💡 小贴士
与 lingma-agents 交流的方式
📜 直接回复评论 直接回复本条评论,lingma-agents 将自动处理您的请求。例如:
-
在当前代码中添加详细的注释说明。
-
请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。
📜 在代码行处标记 在文件的特定位置创建评论并 @lingma-agents。例如:
-
@lingma-agents 分析这个方法的性能瓶颈并提供优化建议。
-
@lingma-agents 对这个方法生成优化代码。
📜 在讨论中提问 在任何讨论中 @lingma-agents 来获取帮助。例如:
-
@lingma-agents 请总结上述讨论并提出解决方案。
-
@lingma-agents 请根据讨论内容生成优化代码。
Thanks for your this PR. :pray:
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
感谢您提交的PR。 :pray:
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API、新增配置参数、修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。
@wqyenjoy
This PR seems contain john's commit so that CLA check can't pass.
I suggest you close this PR and resubmit a new one without john's commit .
@wqyenjoy
This PR seems contain john's commit so that CLA check can't pass.
I suggest you close this PR and resubmit a new one without john's commit .
ok,i will try it again
@wqyenjoy
This PR seems contain john's commit so that CLA check can't pass.
I suggest you close this PR and resubmit a new one without john's commit .
fianlly,get it done.
- config_info_beta
finally,remove the onfig_info_beta table,and change the health check sql,and add some test case.
- config_info_beta
finally,remove the onfig_info_beta table,and change the health check sql,and add some test case.
The Indent problem still not fix
finally,pass ,result @KomachiSion 检查完成。 You have 0 Checkstyle violations.
finally,pass ,result @KomachiSion 检查完成。 You have 0 Checkstyle violations.
OK, I will rerun the CI.
@wqyenjoy It seems some problem in compile
i will solve this problem
---Original--- From: "杨翊 @.> Date: Mon, Jul 21, 2025 10:19 AM To: @.>; Cc: @.@.>; Subject: Re: [alibaba/nacos] fix: Remove beta table & migrate to gray (PR#13603)
KomachiSion left a comment (alibaba/nacos#13603)
@wqyenjoy It seems some problem in compile
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>