Restart gitbase makes indexes outdated #612
Description
Every time when I restart gitbase I get a warning about outdated indexes:
WARN[0000] index "email_idx" is outdated and will not be used, you can remove it using `DROP INDEX email_idx`
Even if nothing physically changed.
Here is a workflow - I had successfully created an index:
CREATE INDEX email_idx ON commits USING pilosa (commit_author_email);
and restarted the gitbase.
Moreover when you show indexes:
SHOW INDEXES FROM commits;
The email_idx
is marked as Visible='No'
.
What in theory is OK (if index is really outdated), but in practice you cannot drop it, because query:
DROP INDEX email_idx ON commits;
returns an error: unknown error: index "email_idx" is still not ready for usage and can't be deleted
And when you try again create the same index, you'll get an error:
unknown error: an index with id "email_idx" has already been registered
.
So you have to once again DROP the index and restart gitbase.
On restart you'll see a warning: WARN[0000] could not read index file, index is corrupt and will be deleted
, but after that you'll be able to create again the index.