-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix scripted metric in ccs #54776
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
Fix scripted metric in ccs #54776
Conversation
`scripted_metric` did not work with cross cluster search because it assumed that you'd never perform a partial reduction, serialize the results, and then perform a final reduction. That serialized-after-partial-reduction step was broken. This is also required to support elastic#54758.
|
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
jimczi
left a comment
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.
Good catch ! I left some minor comments but the change makes sense to me.
| # scripted_metric | ||
| - do: | ||
| search: | ||
| rest_total_hits_as_int: true |
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.
let's use the new format for total hits ?
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.
Sure! I figured I'd be backporting it and that I'd just uses what is with the rest of the file. But you are right, I really should use the new one.
| MockBigArrays bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService()); | ||
| if (randomBoolean() && toReduce.size() > 1) { | ||
| // sometimes do an incremental reduce | ||
| // sometimes do an partial reduce |
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.
nit: a partial reduce
| /* | ||
| * sometimes simulate cross cluster search by serializing and | ||
| * deserializing the partially reduced result. | ||
| */ |
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.
Should it simply say that we test the serialization of partially reduced result since you have another change that will make this possible in normal search ?
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.
Sure.
|
Thanks @jimczi ! |
|
run elasticsearch-ci/2 |
|
Thanks @jimczi! |
`scripted_metric` did not work with cross cluster search because it assumed that you'd never perform a partial reduction, serialize the results, and then perform a final reduction. That serialized-after-partial-reduction step was broken. This is also required to support elastic#54758.
`scripted_metric` did not work with cross cluster search because it assumed that you'd never perform a partial reduction, serialize the results, and then perform a final reduction. That serialized-after-partial-reduction step was broken. This is also required to support #54758.
`testReduceRandom` was bumping up against the serialization that I added in #54776. This makes it use random values that reduce in ways that don't cause the randomized serialization to fail.
`testReduceRandom` was bumping up against the serialization that I added in #54776. This makes it use random values that reduce in ways that don't cause the randomized serialization to fail.
scripted_metricdid not work with cross cluster search because itassumed that you'd never perform a partial reduction, serialize the
results, and then perform a final reduction. That
serialized-after-partial-reduction step was broken.
This is also required to support #54758.