fix(backend): health ready 增加真实 OLTP 探测不可达返回 503 - #75
Merged
Merged
Conversation
This was referenced Sep 27, 2026
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.
What & why
修复 #71 / 矩阵 D-8:
/health/ready的就绪判定diagnostics.get("oltp") is not None恒为 True(database_diagnostics是纯元数据构造、不做连通性探测),OLTP 完全不可达时仍返回"ready",与 DEPLOYMENT.md §3.1「深度就绪」契约不符。修复:ready 增加与 live 同款的
SELECT 1真实探测;OLTP 不可达 →not_ready+ 503(携带脱敏后的oltp_error);DuckDB 降级与调度器禁用仍为 ready(受支持形态,DEPLOYMENT.md §1.4)。Refs #71(Parent #6)。Closes #71。
Area
Verification
tests/test_health_endpoints.py:live/ready 四态路由级回归(正常 / 调度器禁用 / DuckDB 降级 / OLTP 不可达 + /health 别名),含 module-loop 与 clean_tables 连接竞争的隔离处理make test-backendexit 0(含新测试)Verifier verdict
CI 门禁即机器 Verifier;行为变更由四态路由测试独立钉死(not_ready 分支从不可达变为有测试覆盖)。
Checklist
issue-<number>-<short-slug>and PR links the issue