fix: sudo -n, SSH env passthrough, filepath.Clean for destDir#371
Merged
bootjp merged 2 commits intofeature/rolling-updatefrom Mar 20, 2026
Merged
fix: sudo -n, SSH env passthrough, filepath.Clean for destDir#371bootjp merged 2 commits intofeature/rolling-updatefrom
bootjp merged 2 commits intofeature/rolling-updatefrom
Conversation
Merged
Co-authored-by: bootjp <1306365+bootjp@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add rolling update support for Raft storage migration
fix: sudo -n, SSH env passthrough, filepath.Clean for destDir
Mar 20, 2026
bootjp
approved these changes
Mar 20, 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.
Three robustness issues in the rolling-update tooling identified in code review.
Changes
scripts/rolling-update.shsudo -neverywhere — replaced baresudowithsudo -n(non-interactive, fail-fast). Addedrequire_passwordless_sudoguard that runs before any privileged operation and emits an actionable error ifNOPASSWDsudo is not configured, preventing indefinite blocking over SSH.SSH env variable passthrough — changed
ssh ... VAR=value 'bash -s'tossh ... env VAR=value bash -s. The original form relies on the remote login shell accepting POSIXVAR=valueprefix syntax, which non-POSIX shells (e.g. fish) reject beforebashever runs.internal/raftstore/migrate.gofilepath.Clean(destDir)— normalizedestDirbefore constructing the.migratingtemp path. Without this, a caller-supplied trailing slash (e.g./path/raft.db/) produces a nested temp dir (/path/raft.db/.migrating) instead of a sibling (/path/raft.db.migrating), causingos.Renameto fail at finalization.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.