nacos icon indicating copy to clipboard operation
nacos copied to clipboard

fix: Remove beta table & migrate to gray

Open wqyenjoy opened this issue 5 months ago • 12 comments

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?

  1. Initialize MySQL with the updated schema file
  2. Start Nacos configured to use the external MySQL
  3. 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.

wqyenjoy avatar Jul 11 '25 05:07 wqyenjoy

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 11 '25 05:07 CLAassistant

修复config_info_beta表缺失导致的错误日志问题

变更概述

问题修复

  • 受影响组件: mysql-schema.sql 数据库表结构
  • 修复内容: 恢复config_info_beta表定义并修正config_info_gray表字段顺序
  • 技术细节:
    • mysql-schema.sql中新增config_info_beta表创建语句(包含iddata_idgroup_id等字段)
    • 调整config_info_gray表字段定义顺序,将tenant_idapp_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 请根据讨论内容生成优化代码。

lingma-agents[bot] avatar Jul 11 '25 05:07 lingma-agents[bot]

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格式)。

github-actions[bot] avatar Jul 11 '25 06:07 github-actions[bot]

@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 .

KomachiSion avatar Jul 17 '25 05:07 KomachiSion

@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 avatar Jul 17 '25 05:07 wqyenjoy

@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.

wqyenjoy avatar Jul 17 '25 15:07 wqyenjoy

  • config_info_beta

finally,remove the onfig_info_beta table,and change the health check sql,and add some test case.

wqyenjoy avatar Jul 17 '25 15:07 wqyenjoy

  • 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

KomachiSion avatar Jul 18 '25 01:07 KomachiSion

finally,pass ,result @KomachiSion 检查完成。 You have 0 Checkstyle violations.

wqyenjoy avatar Jul 18 '25 09:07 wqyenjoy

finally,pass ,result @KomachiSion 检查完成。 You have 0 Checkstyle violations.

OK, I will rerun the CI.

KomachiSion avatar Jul 21 '25 02:07 KomachiSion

@wqyenjoy It seems some problem in compile

KomachiSion avatar Jul 21 '25 02:07 KomachiSion

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: @.***>

wqyenjoy avatar Jul 21 '25 02:07 wqyenjoy