-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eagerly check keyword field length #83738
Conversation
… keyword field is bigger than 32766
Pinging @elastic/es-search (Team:Search) |
server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR. I've left some comments.
server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java
Outdated
Show resolved
Hide resolved
TBR |
@elasticmachine update branch |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've asked for the comment to be changed, otherwise LGTM
server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
Outdated
Show resolved
Hide resolved
@elasticmachine test this please |
Thank you @kkewwei! |
@kkewwei please enable the option "Allow edits and access to secrets by maintainers" on your PR. For more information, see the documentation. |
server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
Show resolved
Hide resolved
Hello! Just noticed an issue around this: the exception thrown by |
If the UTF8 encoding of a keyword field value is bigger than the max length 32766, Lucene fill fail the indexing request and, to roll back the changes, will mark the (possibly partially indexed) document as deleted. This results in deletes, even in an append-only workload, which in turn leads to slower merges, as these will potentially have to fall back to MergeStrategy.DOC instead of MergeStrategy.BULK. To avoid this, we do a preflight check here before indexing the document into Lucene.
Relates #80865