fast_data: skip deleting files that don't exist on disk #91
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.
This one-liner fixes an issue with fast_data. It's intended to delete old versions of files but keep their records behind, while setting the exists_on_disk column to indicate it no longer exists.
The problem is with successive runs. It doesn't check this column before trying to delete, so it will delete files it's already deleted.
This PR adds a simple check for this flag and skips the deletion step if the database doesn't think the file exists. If the database thinks it exists and it's not actually there, it still errors--that's a consistentcy problem.
PR Checklist
Closes #
if this PR closes the issue, or some other reference, such asSee #
if it is related in some other way)fast_data is currently untested (its functionality really needs to be wrapped up into main dbp), so there's no test on this.