Skip to content
Snippets Groups Projects
Commit 5b5a0568 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

vinyl: do not discard run on dump/compaction abort if index was dropped

If an index is dropped while a dump or compaction task is in progress
we must not write any information about it to the vylog when the task
completes otherwise there's a risk of getting a vylog recovery failure
in case the garbage collector manages to purge the index from the vylog.

We disabled logging on successful completion of a dump task quite a
while ago, in commit 29e2931c ("vinyl: fix race between compaction
and gc of dropped LSM"), and for compaction only recently, in commit
ae6a02eb ("vinyl: do not log dump if index was dropped"), but the
issue remains for a dump/compaction failure, when we log a discard
record for a run file we failed to write. These results in errors like:

```
ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Run 6 deleted twice
```

or

```
ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Run 5768 deleted but not registered
```

Let's fix these issues in exactly the same way as we fixed them for
successful dump/compaction completion - by skipping writing to vylog
in case the index is marked as dropped.

Closes #10452

NO_DOC=bug fix

(cherry picked from commit de59504c2bdb0369cdd27af892301f8515293fe1)
parent a9b5ae1d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment