Add safety check to repair that prevents deleting unknown new backups #4968
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.
If any dlist files have a newer timestamp than the last database backup, the repair is aborted before remote files are deleted. This prevents data loss like in #4579, when an outdated version of the local database is used with a newer remote backup.
This affects both the CLI and GUI repair operations. An override is not provided. The user has to delete the additional dlist files manually if the data loss is intended. After that, leftover dblock files are cleaned up as usual.
Steps to reproduce error:
Current behavior:
New behavior:
The remote files seem to be newer than the local database. Repair would cause data loss. Run recreate instead if the remote files are not corrupted.
I am not sure whether the new error message needs to be translated or not (most others in the repair command do not seem to be).