fix: 网关限流系统配置 Key 改为三段式,修复注册失败
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m35s

- 受控系统配置要求 Key 至少三段,原两段式 Key(如 polling.rate_limit_mode)注册被拒,后台不可见、限流器只能使用默认值
- Key 改为 polling.gateway.* 与 polling.stop_resume_record.*;新增迁移 000247 将已落库的旧 Key 改名并保留取值
- 后续提案中规划的开关同步改为三段式(polling.scheduler.mode、polling.stop_resume.queue_enabled)
This commit is contained in:
邹进
2026-10-24 16:17:34 +09:00
parent 9b0930db9f
commit 02a842f066
16 changed files with 70 additions and 34 deletions

View File

@@ -0,0 +1,8 @@
-- 回滚网关限流配置 Key 改名:恢复为 000246 的两段式 Key,保留值,与 up 成对。
UPDATE tb_system_config SET config_key = 'polling.rate_limit_mode', updated_at = NOW() WHERE config_key = 'polling.gateway.rate_limit_mode';
UPDATE tb_system_config SET config_key = 'polling.gateway_default_qps', updated_at = NOW() WHERE config_key = 'polling.gateway.default_qps';
UPDATE tb_system_config SET config_key = 'polling.rate_limited_retry_delay_seconds', updated_at = NOW() WHERE config_key = 'polling.gateway.rate_limited_retry_delay_seconds';
UPDATE tb_system_config SET config_key = 'polling.rate_limit_defer_alert_seconds', updated_at = NOW() WHERE config_key = 'polling.gateway.rate_limit_defer_alert_seconds';
UPDATE tb_system_config SET config_key = 'polling.stop_resume_record_retention_months', updated_at = NOW() WHERE config_key = 'polling.stop_resume_record.retention_months';
UPDATE tb_system_config SET config_key = 'polling.stop_resume_record_premake_months', updated_at = NOW() WHERE config_key = 'polling.stop_resume_record.premake_months';

View File

@@ -0,0 +1,28 @@
-- 网关限流受控系统配置 Key 改为三段式(add-carrier-gateway-rate-limit 修正)。
-- 背景:受控系统配置注册表要求 Key 至少三段(如 carrier_callback.ctcc_realname.enabled),000246 插入的 Key 只有两段,
-- 代码注册时被拒绝("系统配置注册信息不完整"),后台看不到也改不了这些配置,限流器只能使用代码默认值。
-- 本迁移只改 Key 名,保留已落库的值;新 Key 已存在时不覆盖(先删旧行避免唯一键冲突)。
UPDATE tb_system_config SET config_key = 'polling.gateway.rate_limit_mode', updated_at = NOW()
WHERE config_key = 'polling.rate_limit_mode'
AND NOT EXISTS (SELECT 1 FROM tb_system_config WHERE config_key = 'polling.gateway.rate_limit_mode');
UPDATE tb_system_config SET config_key = 'polling.gateway.default_qps', updated_at = NOW()
WHERE config_key = 'polling.gateway_default_qps'
AND NOT EXISTS (SELECT 1 FROM tb_system_config WHERE config_key = 'polling.gateway.default_qps');
UPDATE tb_system_config SET config_key = 'polling.gateway.rate_limited_retry_delay_seconds', updated_at = NOW()
WHERE config_key = 'polling.rate_limited_retry_delay_seconds'
AND NOT EXISTS (SELECT 1 FROM tb_system_config WHERE config_key = 'polling.gateway.rate_limited_retry_delay_seconds');
UPDATE tb_system_config SET config_key = 'polling.gateway.rate_limit_defer_alert_seconds', updated_at = NOW()
WHERE config_key = 'polling.rate_limit_defer_alert_seconds'
AND NOT EXISTS (SELECT 1 FROM tb_system_config WHERE config_key = 'polling.gateway.rate_limit_defer_alert_seconds');
UPDATE tb_system_config SET config_key = 'polling.stop_resume_record.retention_months', updated_at = NOW()
WHERE config_key = 'polling.stop_resume_record_retention_months'
AND NOT EXISTS (SELECT 1 FROM tb_system_config WHERE config_key = 'polling.stop_resume_record.retention_months');
UPDATE tb_system_config SET config_key = 'polling.stop_resume_record.premake_months', updated_at = NOW()
WHERE config_key = 'polling.stop_resume_record_premake_months'
AND NOT EXISTS (SELECT 1 FROM tb_system_config WHERE config_key = 'polling.stop_resume_record.premake_months');
-- 新 Key 已存在时,残留的旧行不再被读取,删除以免后台列表混淆。
DELETE FROM tb_system_config WHERE config_key IN (
'polling.rate_limit_mode', 'polling.gateway_default_qps', 'polling.rate_limited_retry_delay_seconds',
'polling.rate_limit_defer_alert_seconds', 'polling.stop_resume_record_retention_months', 'polling.stop_resume_record_premake_months');