Commit 7415574f authored by Andreas Brandl's avatar Andreas Brandl

Exclude temporary indexes from reindexing

parent 8fd2496a
......@@ -19,6 +19,7 @@ module Gitlab
.where('NOT expression')
.not_match("^#{ConcurrentReindex::TEMPORARY_INDEX_PREFIX}")
.not_match("^#{ConcurrentReindex::REPLACED_INDEX_PREFIX}")
.not_match("#{ReindexConcurrently::TEMPORARY_INDEX_PATTERN}$")
end
end
end
......
......@@ -31,7 +31,7 @@ RSpec.describe Gitlab::Database::Reindexing do
it 'retrieves regular indexes that are no left-overs from previous runs' do
result = double
expect(Gitlab::Database::PostgresIndex).to receive_message_chain('regular.where.not_match.not_match').with(no_args).with('NOT expression').with('^tmp_reindex_').with('^old_reindex_').and_return(result)
expect(Gitlab::Database::PostgresIndex).to receive_message_chain('regular.where.not_match.not_match.not_match').with(no_args).with('NOT expression').with('^tmp_reindex_').with('^old_reindex_').with('\_ccnew[0-9]*$').and_return(result)
expect(subject).to eq(result)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment