Skip to content

Fix create_migrations_index for ES6

Dmitry Gruzd requested to merge fix-es-migrations-for-es6 into master

What does this MR do?

This MR fixes an exception for Elasticsearch 6 (ES7 works fine and we test against it in our specs) when we're trying to create a migrations index.

[1] pry(main)> Gitlab::Elastic::Helper.default.create_migrations_index
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [completed : {type=boolean}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [properties]: Root mapping definition has unsupported parameters:  [completed : {type=boolean}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [completed : {type=boolean}]"}},"status":400}
from /home/dgruzd/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/elasticsearch-transport-6.8.2/lib/elasticsearch/transport/transport/base.rb:208:in `__raise_transport_error'

QA pipeline that caught this error: https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/847304449

Reported in: #281934 (comment 447152555)

Screenshots (strongly suggested)

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
Edited by Dmitry Gruzd

Merge request reports