Fix ES illegal_argument_exception
What does this MR do?
Elasticsearch fails with illegal_argument_exception
because of the default highlight.max_analyzed_offset
setting which is set to 1000000c bytes by default.
gitlab-elasticsearch-indexer on the other hand has a limit set to 1048576 bytes. This difference creates the problem for files with the size from 1000000c to 1048576 bytes. data/team.yml
is one of those files.
This MR changes highlight.max_analyzed_offset
to 1048576 for our index to make it consistently 1 MiB.
Additionally we should run this command on staging and production to apply this fix without index recreation
curl -XPUT 'https://CLUSTER_DOMAIN/gitlab-production/_settings' -H 'Content-Type: application/json' -d '{
"index": {
"highlight.max_analyzed_offset": 1048576
}
}'
How to repeat the problem
I used this repo locally and on staging to recreate the problem, for example, searching inside of this repo for structural
results in 500
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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
Tasks
-
Update the config on staging -
Update the config on prod
Closes #218576 (closed)