Skip to content

Only use Elasticsearch if all projects in search scope have been initially indexed

Dylan Griffith requested to merge 33681-percentage-rollout-elasticsearch into master

What does this MR do?

This is step 1 for #33681 (closed) .

Then the main change in this MR introduces is to check whether or not all projects have been indexed once before using Elasticsearch for searches. If we've not gotten to all the projects yet in a group then we don't want to use Elasticsearch yet and hence we fallback to the basic Postgres/Gitaly search. When searching in the context of a single project then we also check that this project has been indexed before using Elasticsearch so it is not just applying to groups.

This is an important step in #33681 (closed) because we will start rolling out Elasticsearch to hundreds/thousands of groups at a time and the queue may get quite long and some projects might take a while before indexing kicks off and we don't want people missing search results for a long time.

This MR also introduces 2 small refactorings:

  • Add some missing override to existing methods
  • Extract Project#find_or_create_index_status! so that we don't need to ignore rubocop CodeReuse warning

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

#33681 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading