Commit 23f6f21
committed
Fix flaky string profiler via global ordinals test
The YAML REST test for "string profiler via global ordinals" asserts
exact values for segments_with_single_valued_ords and
segments_with_multi_valued_ords in the aggregation profile debug
output. These assertions are non-deterministic when concurrent search
is enabled.
With concurrent search, a single segment's doc ID space is
partitioned across multiple slices, each with its own
GlobalOrdinalsStringTermsAggregator instance and independent profiling
counters. ConcurrentAggregationProfiler.reduceProfileResultsTree()
does not merge the debug maps across slices — it simply assigns the
last slice's debug info, discarding all others. Which slice is "last"
depends on iteration order, making the reported values arbitrary.
A proper fix would require changing the debug info API so that
aggregators can declare a merge strategy (sum, max, last, etc.) for
each key. The current API uses an untyped Map<String, Object> with no
way to distinguish counters from cardinalities, thresholds, or other
numeric values, so there is no safe generic merge.
Relax the assertions to gte: 0 to verify the fields exist without
depending on specific values.
Signed-off-by: Andrew Ross <andrross@amazon.com>1 parent cfebc67 commit 23f6f21
File tree
1 file changed
+4
-4
lines changed- rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation
1 file changed
+4
-4
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
1078 | | - | |
| 1077 | + | |
| 1078 | + | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
1129 | | - | |
| 1128 | + | |
| 1129 | + | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| |||
0 commit comments