-
Notifications
You must be signed in to change notification settings - Fork 99
Fix optional/missing fields reported via Java client issues #1823
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
Conversation
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
@@ -36,7 +36,7 @@ export class ErrorCause | |||
/** | |||
* A human-readable explanation of the error, in english | |||
*/ | |||
reason: string |
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.
Hmm! When can an error not have a reason
?
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 went digging to understand this, as it was surprising but happening in the wild ;-)
ErrorCause
is the JSON representation of a Java exception (a Throwable
). The reason
field is the result of Java's Throwable.getMessage()
, which according to the docs can be null
. In practice this never (I guess) happens for the top-level error, which is generally an ElasticsearchException
. The error here happened in a deeper root cause, where apparently getMessage()
returned null
🤷
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.
null can happen when it's same exception as before in case of NullPointerException
- jvm can optimize them out
@@ -21,7 +21,7 @@ import { Dictionary } from '@spec_utils/Dictionary' | |||
import { Field } from '@_types/common' | |||
import { Script } from '@_types/Scripting' | |||
|
|||
export type RuntimeFields = Dictionary<Field, RuntimeField | RuntimeField[]> | |||
export type RuntimeFields = Dictionary<Field, RuntimeField> |
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.
Do we know why this originally was made an array?
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.
No idea. There's no occurrence of the array variant in our recordings and looking at the ES source code it has always expected the mapping to be an object and not an array.
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.
Few questions, the rest of the changes look good.
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.
LGTM
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.17 7.17
# Navigate to the new working tree
cd .worktrees/backport-7.17
# Create a new branch
git switch --create backport-1823-to-7.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 33dd0578abec42e588e7cbcf35ad9d9d29723190
# Push it to GitHub
git push --set-upstream origin backport-1823-to-7.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.17 Then, create a pull request where the |
…1826) Co-authored-by: Sylvain Wallez <[email protected]>
This PR fixes a number of fields that should be optional and also adds
SearchRequest.ext
that is undocumented but is present in HLRC and used by some plugins to add new sections to search requests.These are bug fixes that should be backported down to 7.17.
IndexVersioning.created
is optional (not present on default index settings)Found in Client 8.2.0 cannot parse response from ElasticsearchIndicesClient#get(GetIndexRequest) elasticsearch-java#286
GeoBoundsAggregate.bounds
should be optional.Found in GeoBoundsAggregate.bounds should be optional elasticsearch-java#383
RuntimeFields
is a dictionary of single values, not an arrayFound in Client version 8.2.2 does not build correct search request with
runtime_mappings
elasticsearch-java#298Search requests have an
ext
field for plugin extensionsFound in Search extension plugins are not supported in new client elasticsearch-java#264
All fields in
IcuCollationTokenFilter
are optionalFound in IcuCollationTokenFilter requires bunch of parameters that are not required on server side elasticsearch-java#353
ComponentTemplateSummary.settings
is optionalFound in GetComponentTemplate throws MissingRequiredPropertyException elasticsearch-java#282
GetUserAccessTokenResponse.refresh_token
is optionalFound in Get MissingRequiredPropertyException on GetTokenRequest elasticsearch-java#332
ErrorCause.reason
is optionalFound in MissingRequiredPropertyException: Missing required property 'ErrorCause.reason' elasticsearch-java#339