test: add //rs/tests/node:xfs_corruption_repair_test#9585
Draft
basvandijk wants to merge 17 commits intomasterfrom
Draft
test: add //rs/tests/node:xfs_corruption_repair_test#9585basvandijk wants to merge 17 commits intomasterfrom
basvandijk wants to merge 17 commits intomasterfrom
Conversation
The test intermittently fails because vm().kill() (virsh destroy) can leave the XFS filesystem on /var/lib/ic/data in a corrupted state. When the VM is restarted with vm().start(), the GuestOS cannot mount the corrupted data partition and enters emergency mode, making the node permanently unreachable. The root cause is in setup-shared-data.sh which only checks whether a filesystem exists (via blkid) but does not verify its integrity. A corrupted XFS filesystem passes the blkid check but fails to mount. Fix: After confirming a filesystem exists, attempt a test mount. If the mount fails (corrupted journal/metadata), run xfs_repair. If repair also fails, reformat the partition. The IC node recovers its state via state sync, so no data is permanently lost. On healthy boots (including those with a dirty but valid XFS journal), the test mount succeeds instantly and replays the journal, causing no additional delay.
Replace the test-mount approach with xfs_repair-based detection. A test mount fails on a dirty-but-valid journal (normal after crash), triggering unnecessary xfs_repair -L and journal data loss. Now xfs_repair (without -L) is used as the check: it exits non-zero with a specific message when the journal just needs replay, which the real mount via fstab handles automatically. Only on actual corruption do we escalate to xfs_repair -L, then reformat as last resort.
…es/setup-shared-data.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Base automatically changed from
ai/deflake-rejoin_test_large_state-2026-03-22
to
master
March 30, 2026 10:30
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.
Based on: #9536.
Adds the
//rs/tests/node:xfs_corruption_repair_testwhich:/var/lib/ic/data./var/lib/ic/data./dev/mapper/store-shared--data.xfs_repair -Lhas ran and that the files in/var/lib/ic/dataare still there.That last step fails for some reason I haven't figured out yet.