Add pre-flight safety checks to rollback script#172
Merged
raymondjacobson merged 6 commits intomainfrom Mar 31, 2026
Merged
Conversation
Prevents running rollback while the node is still up, which can corrupt postgres by starting a second instance on the same data directory. Also renames the rollback binary destination from /bin/rollback to /bin/rollback-bin in the Dockerfile to avoid Docker COPY creating a directory instead of placing the file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3318e49 to
3dc5f52
Compare
The rollback is typically run as a separate container (docker run --rm) sharing only the /data volume. Process-based checks like kill -0 and fuser don't work across PID namespaces. Replace with filesystem-level checks on the shared volume: - postmaster.pid existence (hard stop, with escape hatch for stale files) - CometBFT PebbleDB LOCK file presence - Network checks (curl, pg_isready) kept as best-effort for --net=host Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PREBUILT_ROLLBACK_BINARY was never set in the CI workflow, so the Dockerfile COPY with an empty arg created /bin/rollback as a directory instead of copying the binary — causing "Is a directory" at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Now that CI properly builds and passes PREBUILT_ROLLBACK_BINARY, the rename workaround is unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove network-based checks (curl, pg_isready) that don't work across Docker containers. Keep only volume-level checks that reliably detect a running node. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Prevents running rollback while the node is still up, which can corrupt postgres by starting a second instance on the same data directory.