[18.11] Backport of Gate commit traversal_ids behind AddTraversalIdsToCommits migration

What does this MR do and why?

Backport of !235227 (merged) to 18.11.

Original issue: #599628 (closed)

Pass --commit-traversal-ids-enabled to gitlab-elasticsearch-indexer only after the AddTraversalIdsToCommits mapping migration has finished.

Until that migration completes, the commits index does not have a traversal_ids field in its mapping. Because GitLab Advanced Search uses strict mapping, Elasticsearch/OpenSearch rejects any commit document that includes an unmapped field, causing all commit indexing to fail with a strict_dynamic_mapping_exception.

Cherry-pick conflict resolution

Cherry-pick had a conflict in GITLAB_ELASTICSEARCH_INDEXER_VERSION because the stable branch is behind master. Resolved by taking the version from the cherry-picked commit (5.14.7), which is required for the indexer to accept the --commit-traversal-ids-enabled flag added by this change.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, reach out to a Software Engineer in Test in #s_developer_experience.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Terri Chu

Merge request reports

Loading