Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Docker migration script now clears existing volume contents before restoring backup data. Newly created volumes keep their existing behavior. ChangesDocker volume restore
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This narrowly scoped change makes volume restores exact by clearing stale contents first; no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@LZY-SPCA I suggest that during restore, if the target volume already exists, we should fail with an error instead of deleting or overwriting its contents. The error message can provide the command for manually removing the volume, leaving that decision explicitly to the user. |
|
I agree that automatically clearing an existing volume during I think there are two safer alternatives:
The main issue I would like to avoid is the current behavior where I am fine with either updating the documentation or changing the restore behavior to reject non-empty/existing volumes. Both approaches would be safer than silently merging the backup with existing volume contents. |
|
I agree to address this issue first via documentation in this PR#18626. Thank you! |
What does this PR do?
Clear the contents of an existing Docker volume before restoring backup data.
Currently,
migration.sh restoreextracts the backup archive directly into an existing volume.tar xzfoverwrites files that exist in the archive, but it does not remove files that exist only in the target volume.As a result, restoring into an existing volume performs a merge instead of an exact restore.
This can cause problems for stateful services such as MySQL. In my case, stale InnoDB redo log files remained after restore and caused MySQL to fail during startup with errors such as: