feat: expose mysql transaction retry metrics

This commit is contained in:
2026-09-20 21:52:17 +08:00
parent a1e6fcc07f
commit ac8cc1260b
10 changed files with 55 additions and 4 deletions

View File

@@ -10,6 +10,7 @@
| 发布物静态身份清单 | 2026-09-20;`make release-manifest`;无 `ORBIT_MYSQL_DSN` | PASS;输出构建/协议身份及28条迁移名称与SHA-256校验和,未读取数据库、凭据或业务数据;目标库仍需单独执行 `orbit-admin verify` |
| 发布物与管理二进制绑定校验 | 2026-09-20;`go test -race ./cmd/orbit-admin`;匹配/修改 revision/未知命令场景 | PASS;`verify --manifest` 在数据库连接前拒绝身份、协议或迁移校验和不一致的清单,匹配清单通过;不修改数据库 |
| 提交前事务死锁恢复 | `go test -race -run TestRetryableTransactionErrorOnlyMatchesPreCommitLockFailures ./internal/storage/mysql`;真实 MySQL `TestIntegrationWithTxRetriesPreCommitDeadlock` | PASS;两事务真实锁环触发 1213,失败事务仅在提交前按有界退避重试一次,最终两笔事务各提交一次;Begin/Commit 错误不重放,目标拓扑锁等待和死锁率仍需生产观测 |
| 提交前事务重试观测 | `internal/observability.TestRuntimeObservationDoesNotExposeErrors`;固定指标目录;`make release-local-check` | PASS;`orbit_db_transaction_retries_total` 与 `orbit_db_transaction_retry_exhausted_total` 以无标签固定计数器导出,重试只在退避成功后计数,提交回执不明不计入;目标拓扑告警阈值和跨节点聚合仍待生产验收 |
| 就绪探针排空门控 | `go test -race ./internal/transport/httpserver ./cmd/orbit`;`TestReadinessEntersDrainBeforeShutdown` | PASS;SIGTERM 关闭路径先将 `/health/ready` 置为 503,再进入限定优雅关闭窗口;响应不泄露内部错误 |
| 健康探针响应契约 | 2026-09-20;`go test ./internal/transport/httpserver && go test -race ./internal/transport/httpserver && make docs-check` | PASS;`/health/live` 与 `/health/ready` 返回 `Cache-Control: no-store`、`X-Content-Type-Options: nosniff`;未就绪和排空状态返回 `Retry-After: 1`,并由 HTTP 契约测试覆盖 |
| 数据模型中文注释门禁 | 2026-09-20;`go test ./internal/storage/mysql -run 'Test(FreshInstallBaselineHasChineseModelComments|FreshInstallBaselineContainsNoReferenceDDL|MigrationsAfterForeignKeyRemovalDoNotReintroduceReferences|PostRemovalMigrationGuard)$'` | PASS;当前无外键基线逐表、逐持久化字段检查中文 `COMMENT`,并继续阻止后续迁移重新引入引用约束 |