Repository navigation
Conversation
按 9f 修订计划第 1 段 1-16 落地五份运行规范文档(M-20/21/23/24/25 的 文档部分),口径对齐 #109 高标准清单 D1/H3、M1/M2/M3、D6/T3、C1/C2/C3、 G1,每份附 54 条适用性说明。全部为设计口径与运行规范,不代表已实现; 数字均注明来源或标「须 1.0 压测/演练定基线」。 Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
按独立验收返工(不改写历史,在原提交上修正): - configuration-layers:go-zero SqlConf 不暴露池配置项与 sqlx 内部 硬编码池参数(64/64/1 分钟,v1.11.0 sqlmanager.go)分层写清; - disaster-recovery-runbook:沟通节奏标本项目建议待演练定稿; 补 RPO 5 分钟前提(日志离故障域、外传周期 ≤RPO、演练从离机落点恢复); - cache-standards:权限缓存改版本键强一致设计,分机制写清一致性强弱, 禁用先删再提交;澄清失效广播与进程内不可变规则的关系; - db-failover-semantics:补 go-zero sqlx 读写分离真实语义 (读默认走主,显式 WithReadReplica 才走从库,多从 round-robin); - go-zero 源码链接全部从 master 改为 v1.11.0 tag 防漂移。 Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
按第二轮独立验收返工(不改写历史): - cache-standards:权限版本键强一致补三条闭合条件——版本号读走主库、 重建走显式主库一致读(不走默认从库)、版本号与载荷同一主库一致读 快照校验,写明「键版本≡载荷版本」不变量与两类错配反例;实现形式 不虚构。C2 矩阵行同步区分权限版本键与字典 cache-aside;D1 适用性 补权限重建走主库的例外。 - disaster-recovery-runbook:archive_timeout 改按官方语义——距上次 切换达阈值且期间有任何数据库活动(含 checkpoint)即强制切换, 是切换间隔上限;已切换 segment 才归档,RPO 口径计入最长一个周期 加外传耗时。 Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
按 9f 修订计划第 1 段 1-16 新增五份运行规范文档(M-20/21/23/24/25 的文档部分):
server/docs/db-failover-semantics.md:M-20 主从切换语义(清单 D1/H3)——连接错误分类、只读可重试、写失败 fail-closed 503、从库延迟摘除回主、切换窗口 5xx ≤60 秒判据;server/docs/disaster-recovery-runbook.md:M-21 故障恢复 runbook(清单 M1/M2/M3)——角色/触发/冻结/判定/切换与恢复步骤/验证/failback/沟通/复盘/演练频率,首期 RTO 1 小时 / RPO 5 分钟口径及测量方法、RPO 前提(日志离故障域、外传周期 ≤RPO);server/docs/slow-query-governance.md:M-23 慢查询治理(清单 D6/T3)——PGstatement_timeout5 秒 / MySQLmax_execution_time、迁移lock_timeout5 秒、大表在线变更通道、慢查询计数进/metrics;server/docs/cache-standards.md:M-24 缓存规范(清单 C1/C2/C3)——分级、权限版本键强一致设计(版本号与载荷同一主库一致读快照、重建走显式主库一致读)、字典 cache-aside 最终一致、穿透/击穿/雪崩三件套;server/docs/configuration-layers.md:M-25 配置分层(清单 G1)——.env/配置文件/库表三层边界、热更键清单、启动 schema 校验拒启、ConfigProviderInterface预留。统一口径:数据库 MySQL 8.4 LTS 起 / PostgreSQL 15 起;每份按 #109「高标准要求/1.0 做什么/1.1 做或不做/理由/以后补的代价/验收指标」矩阵作答并附 54 条适用性说明;数字均注明来源(含 Spring Boot / go-zero 官方文档与 v1.11.0 源码 permalink、MySQL/PG 官方文档 URL)或标「本项目建议,须 1.0 压测/演练定基线」。
重要声明:这些是运行规范与设计口径,不代表当前代码已实现;未做真实主从切换或恢复演练,文中验收项在执行前状态均为「未验证」。
Baseline 说明
开工基线为
5360129(2026-11-28 开工时 main);创建 PR 时远端 main 已前进至f1e7c5c,本分支未 rebase。改动全部为server/docs/新增文档,与其他在途 PR 无文件级冲突。Test plan / checks
git diff --check/git diff --cached --check:PASS;python3 naming_check.py notes(五文档):PASS,无 FAIL/WARN;bash tools/pre-merge.sh --fast:PASS 全 8 步——模块测试目录检查、PHP 语法、契约一致性、危险函数白名单、dev-only 引用、TypePHP diff 扫描(FAIL=0/WARN=0)、PHPUnit Unit 737 tests / 6877 assertions OK、PHPStan No errors;.md;Generated with Devin