PXB-3241 : Assertion failure: os0file.cc:3416:!exists while taking ba… #1554
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.
…ckups with lock-ddl=REDUCED
Problem:
Backups taken with lock-ddl=reduced, prepare failed to complete.
Analysis:
When handling .ren files, the destination file name already exists and this causes assertion failure. See the below backup log
Whats going on here?
Lets say we have partition p3 with space id 425. This is being altered. So partition algorithm does this:
The rename file for space_id 425 is skipped, because we knowthat it is dropped. So only a .del file. Final state of backup is:
===
788 in backup with name #sql1
425 in backup with name p3
788.ren file-> 788 From: test/#sql-1fc79d_13#p#p3.ibd To: test/tt_28_p#p#p3.ibd 425.drop file
===
Now prepare starts to process .ren files
it tries to rename 788 from #sql1 to p3. but p3 already exists..
Fix:
we skip rename and other operations if we know that tablespace is going to be dropped. In the above example, we skipped 425.ren file.
So while preparing, we should handle the .del files first. Then we are applying all the consolidated operations in a way. Then .ren can be processed