Remove index prior to creation
What does this MR do?
Concurrent index creation can fail and leave behind indexes marked as INVALID
. When the migration is retried, it would look like the index existed already and we would skip its creation. However, an INVALID
index does not recover on its own and is also not usable by queries.
Before we create an index (concurrently), we check if the index already exists and is in INVALID
state. If it is, we remove it before we attempt to create it again. We leave it untouched if it is not marked INVALID
.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Andreas Brandl