vinyl: fix recovery after aborted index creation
There's a bug in the code building index hash on recovery: we replace a dropped index with any newer index, even incomplete one. Apparently, this is wrong, because a dropped index may have been dropped during final recovery and hence is still needed for initial recovery. If we replace it with an incomplete index in the index hash, initial recovery will fail with ER_INVALID_VYLOG_FILE: Invalid VYLOG file: LSM tree 512/1 not found (see vy_lsm_recover()). Fix this problem by checking create_lsn of the index that is going to replace a dropped one - if it's negative, we must link it to the dropped index via vy_lsm_recovery_info->prepared instead of inserting it into the hash directly. Closes #4066
Please register or sign in to comment