OpenSearch/modules
Nik Everett 0c47d49784
Make sure non-collecting aggs include sub-aggs (backport of #64214) (#64247)
Now that we're consistently using `cat_match` to filter which shards we
run on we can get this confusing case:
1. You have a search with, say, a range and a sub-agg.
2. That search has a query that `can_match` can recognize will match no
   docs. On *any* shard.
3. So we dutifully run it on a single shard so it can produce the
   "empty" aggs.
4. The shard we pick happens to not have the target of the range mapped.
5. This kicks in the special range aggregator that doesn't collect any
   documents.
6. Before this commit, that range aggregator *also* never produced any
   sub-aggs.

So, without this change, it was quite possible for a search that
happened to match no documents to "throw away" the sub-aggs of a range
and a few other aggs.

We've had this problem for a long, long time but it is more confusing
now because `can_match` is really kicking in and causing us to see cases
where it looks like you are targeting a lot of shards but you really are
only targeting a couple. It used to be that to get the "no sub-aggs"
behavior you had to explicitly target only shards that didn't map the
target field of the `range` agg. And, like, in that case it isn't too
bad because you targeted a sort of degenerate shard. But now that
`can_match` is doing its thing you can end up with the confusing steps
above. It took me several hours to track down what what happening I know
how the individual pieces of all of this works. It took four hours to
figure out how they fit together in this case....

Anyway! This replaces all the aggregator implementations that throw out
the sub-aggregators with ones that keep them. I think this'll be less
confusing in the future.

Closes #64142
2020-10-28 08:38:05 -04:00
..
aggs-matrix-stats Only call reduce on a single InternalAggregation when needed (#62525) (#62594) 2020-09-18 08:43:58 +02:00
analysis-common Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
geo Add search `fields` parameter to support high-level field retrieval. (#60258) 2020-07-28 10:58:20 -07:00
ingest-common Fix failure in AppendProcessorTests.testAppendingToListWithDuplicatesDisallowed (#62842) (#63499) 2020-10-08 13:15:29 -05:00
ingest-geoip [7.x] Add network from MaxMind Geo ASN database (#61676) (#62898) 2020-10-01 11:01:44 -05:00
ingest-user-agent Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
kibana Correct system index names in Kibana module (#64011) 2020-10-21 12:11:10 -06:00
lang-expression Upgrade to lucene-8.7.0-snapshot-72d8528c3a6 (#63912) (#63928) (#63933) 2020-10-20 15:08:06 +02:00
lang-mustache Deprecate REST access to System Indices (#63274) (Original #60945) 2020-10-06 13:41:40 -06:00
lang-painless Scripting: JSON parsing and writing in watcher (#63278) (#63377) 2020-10-06 23:39:40 -05:00
mapper-extras Add support for missing value fetchers. (#63585) 2020-10-12 17:34:21 -07:00
parent-join Make sure non-collecting aggs include sub-aggs (backport of #64214) (#64247) 2020-10-28 08:38:05 -04:00
percolator Add factory methods for common value fetchers. (#63438) 2020-10-08 12:14:53 -07:00
rank-eval Optimize XContentParserUtils.ensureExpectedToken (#62691) (#63253) 2020-10-05 19:08:32 +02:00
reindex [7.10] Move RestRequestFilter to core (#63507) 2020-10-16 13:57:52 +03:00
repository-url [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
systemd [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
transport-netty4 Transfer network bytes to smaller buffer (#62673) 2020-10-01 10:39:24 -06:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00