-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: Move files to correct /data directory if any volume-related data exists in /tmp for SeaweedFS
#4000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
install/turn-things-off.sh
Outdated
| echo "${_group}Turning things off ..." | ||
|
|
||
| # Only execute this when `seaweedfs` container is running | ||
| if ! $dc ps --quiet seaweedfs; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: The condition if ! $dc ps --quiet seaweedfs incorrectly checks the command's exit code instead of its output, causing it to always execute the else block.
-
Description: The condition
if ! $dc ps --quiet seaweedfsincorrectly evaluates the exit code of thedocker-composecommand instead of its output. Since$dc ps --quiet seaweedfsalways has an exit code of 0, the condition is always false, causing theelseblock to execute unconditionally. This block attempts to rundocker compose execon theseaweedfscontainer. On fresh installations or when containers are stopped, theseaweedfscontainer isn't running. Theexeccommand fails, and because the parentinstall.shscript usesset -e, the entire installation or upgrade process will crash. -
Suggested fix: The check should be changed to verify if the command's output is empty, which correctly indicates whether the container is running. Use
if [ -z "$($dc ps --quiet seaweedfs)" ]to skip the migration logic when theseaweedfscontainer is not found.
severity: 0.9, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4000 +/- ##
=======================================
Coverage 99.49% 99.49%
=======================================
Files 3 3
Lines 197 197
=======================================
Hits 196 196
Misses 1 1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
25.10.0 is released. Too late / not relevant anymore. |
|
@aldy505 why? We can always make a patch release and tell people to skip this one? |
|
My suggestion was for folks who have already upgraded to 25.9 but not to 25.10 yet as if they do, they'll lose data, right? |
Yeah, that's true. |
|
Got hit by this and wanted to say it may be worth to enable read-only root fs for the containers by default; it will reject writes to non-volume paths ie prevent writes data to volatile paths like this. For actual temp data paths one can use the tmpfs volume type in Docker to explicitly declare such volatile paths and allow writes there. Much less error prone. 😃 |
This is a followup for #3991 and an alternative of #3999 that doesn't use a lock file.