Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Apr 5, 2020

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.

`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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Aggregations)

Copy link
Contributor

@jimczi jimczi left a 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
Copy link
Contributor

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 ?

Copy link
Member Author

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
Copy link
Contributor

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.
*/
Copy link
Contributor

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 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@nik9000
Copy link
Member Author

nik9000 commented Apr 6, 2020

Thanks @jimczi !

@nik9000
Copy link
Member Author

nik9000 commented Apr 6, 2020

run elasticsearch-ci/2

@nik9000
Copy link
Member Author

nik9000 commented Apr 7, 2020

Thanks @jimczi!

@nik9000 nik9000 merged commit 1714646 into elastic:master Apr 7, 2020
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Apr 7, 2020
`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.
nik9000 added a commit that referenced this pull request Apr 7, 2020
`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.
nik9000 added a commit that referenced this pull request Apr 7, 2020
`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.
nik9000 added a commit that referenced this pull request Apr 7, 2020
`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants