Order async indexes by asc attempts, id
Ref: #495697 (closed)
What does this MR do and why?
This MR orders PostgresAsyncIndex by ascending attempts and ids.
This will allow indexes scheduled to be created/removed without any failures to get pick up first in the queue and prevent this kind of behavior.
Query plans
Before | After |
---|---|
Index creation | Index creation |
Index destruction | Index destruction |
This should be fine as we have < 10 records in the queue.
gitlabhq_dblab=# select count(*) from postgres_async_indexes;
count
-------
7
(1 row)
Edited by Max Orefice