distfiles: let the sync and the audit write to a parallel root - #242
Merged
Conversation
重建演练量不到 distfiles 那一段:正式流程会改写正式状态,所以无法在平行根上 执行。五处路径写死在正式位置——`distfiles-sync.sh` 的两个日志, `audit-distfiles.py` 的孤儿状态、回收目录与清理账本。 五处都改成可用环境变量覆盖,预设值保持现在的正式路径不变,沿用同一支脚本里 既有的写法。孤儿状态用 `ORPHAN_STATE` 而不是 `STATE`:`distfiles-sync.sh` 的 `STATE` 指的是 emirrordist 的状态目录,两者含义不同,同名会在演练里互相踩到。 `docs/recovery.md` 的 distfiles 那一节给出可照抄的隔离命令,并写明实测数字 仍待补。
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.
docs/recovery.md里 distfiles 的恢复时间是空的:正式流程会改写正式同步状态,所以那一段无法在平行根上演练。
五处路径写死在正式位置:
deploy/distfiles-sync.sh的--success-log与--failure-log,deploy/audit-distfiles.py的孤儿状态、回收目录与清理账本。五处都改成可覆盖,预设值保持现在的正式路径不变。
孤儿状态的环境变量取名
ORPHAN_STATE而不是STATE:distfiles-sync.sh已经用STATE表示 emirrordist 的状态目录,而这里指的是orphans.json档案,同名会让演练里两条命令互相踩到。
变异反证
五个覆盖点各注入一次,把读取覆盖那行改回写死,对应测试都转红:
ORPHAN_STATE、RECYCLE、LEDGER(test-audit-distfiles.py)、FAILURE_LOG、SUCCESS_LOG(test-distfiles-temp-device.py)。测试
本机全套 Python、Shell、JavaScript 测试、
check-copy、py_compile与check-commits通过。没有执行任何真实同步,也没有存取/srv或/var/log。docs/recovery.md的 distfiles 那一节给出可照抄的隔离命令,并明确写出实测数字仍待补,不填估算值。