feat(installer): fail fast when HOST_DATA_DIR is on a network filesystem#261
Open
saadqbal wants to merge 1 commit into
Open
feat(installer): fail fast when HOST_DATA_DIR is on a network filesystem#261saadqbal wants to merge 1 commit into
saadqbal wants to merge 1 commit into
Conversation
Detect NFS/CIFS/SMB for HOST_DATA_DIR in preflight (bash + PowerShell) and fail fast with an actionable message instead of a cryptic MySQL CrashLoopBackOff ~20 min into install: MySQL/InnoDB corrupts on network storage and the chart root chown init-container is blocked by NFS root_squash. - preflight.sh: _pf_fstype reader (findmnt, then GNU stat, then df+mount; portable incl. macOS) + _pf_storage_type wired into run_preflight. Allowlists network fstypes so local FSes including overlay/tmpfs (CI) pass. - install-k8s.ps1: Get-PfFsType (UNC / network drive) + Test-Preflight check. - TRACEBLOC_ALLOW_NETWORK_FS=1 overrides (mirrors TRACEBLOC_ALLOW_ARM64). - Tests: 10 bats cases + Pester cases (network -> fail, override, undetermined, Windows-only Get-PfFsType reader). Part 1 of 3 for tracebloc/backend#743. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
👋 Heads-up — Code review queue is at 15 / 8 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
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
Part 1 of 3 for tracebloc/backend#743 — support VMs with network-mounted (NFS) storage.
Adds a preflight guard that detects when
HOST_DATA_DIRis on a network filesystem (NFS/CIFS/SMB) and fails fast with an actionable message, instead of the current cryptic MySQLCrashLoopBackOff~20 minutes into an otherwise-successful install.Why
MySQL/InnoDB corrupts or crash-loops on network storage (broken POSIX file locking + unsafe
O_DIRECT/fsync), and the chart's root chown init-container is blocked by NFSroot_squash. Today this surfaces as a cryptic failure late in the install; this catches it in seconds with a clear remedy.Changes
scripts/lib/preflight.sh: new_pf_fstypereader (findmnt→ GNUstat -f→df+mount; portable incl. macOS, where BSDstat -fmeans format string, not filesystem type) and a_pf_storage_typecheck wired intorun_preflight. It allowlists the network fstypes to reject so local filesystems — includingoverlay/tmpfsused by CI runners — always pass.scripts/install-k8s.ps1:Get-PfFsType(UNC path / mapped network drive viaWin32_LogicalDisk DriveType 4) + the matching check inTest-Preflight.TRACEBLOC_ALLOW_NETWORK_FS=1proceeds anyway (mirrors the existingTRACEBLOC_ALLOW_ARM64). This is also the seam Part 3 will use to allow datasets on NFS.HOST_DATA_DIRhelp note (bash--help+ PS header) + the preflight escape-hatch header block.Tests
scripts/tests/preflight.bats: 10 new cases — local/overlaypass;nfs/nfs4/cifs/fuse.sshfshard-fail; override warns; undetermined assumes local; reader lower-cases + walks to the nearest existing parent; live reader on the host.scripts/tests/install-k8s.Tests.ps1:Test-Preflightnetwork / override / undetermined cases + a Windows-onlyGet-PfFsTypereader block.bats47/47 green,shellcheck --severity=errorclean, both PS files parse +Get-PfFsTypelogic verified (UNC→network, unix-path→local). CIunit-pesterruns the full Pester suite on ubuntu + windows.Backward compatibility
No behavior change for local installs (the default
~/.traceblocis local). The check only adds a hard-fail when the data dir is genuinely on a network FS, with a documented override.Follow-ups (same issue)
uid/gid/fsGroup(run storage pods as the host user) + storage split (MySQL/logs local, datasets on the network mount).tracebloc/docs): Quick Start storage requirement + a MySQL-CrashLoop→NFS troubleshooting entry.🤖 Generated with Claude Code
Note
Low Risk
Installer-only preflight change; default local paths are unchanged, with an explicit env override for edge deployments.
Overview
Installers now reject
HOST_DATA_DIRon network filesystems during preflight (NFS/CIFS/SMB on Unix/macOS; UNC or mapped network drives on Windows), with a clear message about MySQL/InnoDB risk instead of a late CrashLoopBackOff.Unix/macOS adds
_pf_fstype/_pf_storage_typeinpreflight.sh(wired intorun_preflight); Windows addsGet-PfFsTypeand the same check inTest-Preflight.TRACEBLOC_ALLOW_NETWORK_FS=1warns and continues; help text documents the rule. Bats and Pester cover fail, override, local/overlay pass, and fstype detection.Reviewed by Cursor Bugbot for commit 227b948. Bugbot is set up for automated code reviews on this repo. Configure here.