Skip to content
Snippets Groups Projects
  • Vladimir Davydov's avatar
    ae6a02eb
    vinyl: do not log dump if index was dropped · ae6a02eb
    Vladimir Davydov authored
    An index can be dropped while a memory dump is in progress. If the vinyl
    garbage collector happens to delete the index from the vylog by the time
    the memory dump completes, the dump will log an entry for a deleted
    index, resulting in an error next time we try to recover the vylog,
    like:
    
    ```
    ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Run 2 committed after deletion
    ```
    
    or
    
    ```
    ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Deleted range 9 has run slices
    ```
    
    We already fixed a similar issue with compaction in commit 29e2931c
    ("vinyl: fix race between compaction and gc of dropped LSM"). Let's fix
    this one in exactly the same way: discard the new run without logging it
    to the vylog on a memory dump completion if the index was dropped while
    the dump was in progress.
    
    Closes #10277
    
    NO_DOC=bug fix
    ae6a02eb
    History
    vinyl: do not log dump if index was dropped
    Vladimir Davydov authored
    An index can be dropped while a memory dump is in progress. If the vinyl
    garbage collector happens to delete the index from the vylog by the time
    the memory dump completes, the dump will log an entry for a deleted
    index, resulting in an error next time we try to recover the vylog,
    like:
    
    ```
    ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Run 2 committed after deletion
    ```
    
    or
    
    ```
    ER_INVALID_VYLOG_FILE: Invalid VYLOG file: Deleted range 9 has run slices
    ```
    
    We already fixed a similar issue with compaction in commit 29e2931c
    ("vinyl: fix race between compaction and gc of dropped LSM"). Let's fix
    this one in exactly the same way: discard the new run without logging it
    to the vylog on a memory dump completion if the index was dropped while
    the dump was in progress.
    
    Closes #10277
    
    NO_DOC=bug fix