fix(postgres): 修正跨地域 WAL 归档带宽预算

将生产 archive_timeout 从 60 秒调整为 5 分钟,避免 16 MiB WAL 段在当前宁波香港链路上持续产生高于复制吞吐的空闲流量。\n\n同步复制保持开启,双库健康时 RPO 仍为 0;单库降级时对象存储归档 RPO 保持在 5 分钟目标内。补充发布回归门禁,防止配置退回无法追平的 60 秒。\n\n验证:kubectl kustomize、bash -n、ShellCheck、manual-release-test。
This commit is contained in:
2026-07-31 18:42:46 +08:00
parent e05922b0f4
commit 0b9634b74c
3 changed files with 11 additions and 2 deletions
+5 -1
View File
@@ -119,7 +119,11 @@ spec:
number: 1
dataDurability: preferred
parameters:
archive_timeout: 60s
# A 16 MiB WAL segment every 60 seconds requires at least 2.24 Mbit/s
# of continuous cross-region throughput even while the database is idle.
# The certified Ningbo/Hong Kong path is below that floor, so keep the
# object-storage RPO within five minutes without starving sync replay.
archive_timeout: 5min
max_connections: "200"
shared_buffers: 512MB
wal_compression: "on"
+1 -1
View File
@@ -10,7 +10,7 @@ CloudNativePG;洛杉矶只作为 K3s server/etcd 仲裁节点,并带
[生产同构验收模式与高媒体压力测试](production-acceptance.md)。
- 健康双库:同步复制,RPO=0。
- 单库降级:`dataDurability: preferred` 保持写入,`archive_timeout=60s`,灾难 RPO 目标不超过 5 分钟。
- 单库降级:`dataDurability: preferred` 保持写入,`archive_timeout=5min`,灾难 RPO 目标不超过 5 分钟。生产 WAL 段为 16 MiB;禁止把该值降到 60 秒,否则仅空闲切段就要求跨地域链路持续承载至少 2.24 Mbit/s,会使同步副本在当前带宽下永久追不平。
- 数据库故障 RTO:不超过 5 分钟。
- 应用发布:香港验收后再滚动宁波,计划内零停机。
- 公网入口:双 NGINX 加人工 AliDNS 切换。接入带健康检查的 GTM 前,不宣称公网入口自动高可用。
+5
View File
@@ -290,5 +290,10 @@ grep -Fq 'gateway_tasks' "$root/deploy/manual/easyai-ai-gateway-release"
grep -Fq 'gateway_task_attempts' "$root/deploy/manual/easyai-ai-gateway-release"
grep -Fq 'gateway_task_events' "$root/deploy/manual/easyai-ai-gateway-release"
grep -Fq 'production_changed=false' "$root/scripts/publish-release-images.sh"
grep -Fq 'archive_timeout: 5min' "$root/deploy/kubernetes/production/database.yaml"
if grep -Fq 'archive_timeout: 60s' "$root/deploy/kubernetes/production/database.yaml"; then
echo 'production archive timeout would exceed the certified cross-region bandwidth floor' >&2
exit 1
fi
echo 'manual_release_tests=PASS'