Skip to content
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

[BUG] The org.opensearch.search.aggregations.EquivalenceIT.testDuelDepthBreadthFirst {p0={"search.concurrent_segment_search.enabled":"true"}} is flaky #12228

Closed
reta opened this issue Feb 7, 2024 · 11 comments
Labels
bug Something isn't working flaky-test Random test failure that succeeds on second run Search:Aggregations Search Search query, autocomplete ...etc

Comments

@reta
Copy link
Collaborator

reta commented Feb 7, 2024

Describe the bug

The test case org.opensearch.search.aggregations.EquivalenceIT.testDuelDepthBreadthFirst {p0={"search.concurrent_segment_search.enabled":"true"}} is flaky:

java.lang.NullPointerException: Cannot invoke "org.opensearch.search.aggregations.bucket.terms.Terms$Bucket.getAggregations()" because "b2" is null

java.lang.NullPointerException: Cannot invoke "org.opensearch.search.aggregations.bucket.terms.Terms$Bucket.getAggregations()" because "b2" is null
	at __randomizedtesting.SeedInfo.seed([AC3DAFC531F23A2A:67D1978CF07120B8]:0)
	at org.opensearch.search.aggregations.EquivalenceIT.testDuelDepthBreadthFirst(EquivalenceIT.java:562)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
	at org.opensearch.test.OpenSearchTestClusterRule$1.evaluate(OpenSearchTestClusterRule.java:369)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
	at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
	at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
	at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
	at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
	at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
	at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
	at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Related component

Search

To Reproduce

./gradlew ':server:internalClusterTest' --tests "org.opensearch.search.aggregations.EquivalenceIT" -Dtests.method="testDuelDepthBreadthFirst {p0={"search.concurrent_segment_search.enabled":"true"}}" -Dtests.seed=AC3DAFC531F23A2A

Expected behavior

The test should always pass

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • CI

Additional context

@reta reta added bug Something isn't working untriaged labels Feb 7, 2024
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Feb 7, 2024
@reta
Copy link
Collaborator Author

reta commented Feb 7, 2024

@jed326 @sohami seems like a new one

@reta reta mentioned this issue Feb 7, 2024
8 tasks
@peternied peternied added flaky-test Random test failure that succeeds on second run and removed untriaged labels Feb 7, 2024
@peternied
Copy link
Member

[Triage - attendees 1 2 3]
@reta Thanks for filing, looking forward to a PR to resolve this.

@jed326
Copy link
Collaborator

jed326 commented Feb 7, 2024

Thanks @reta, will look into this today

@jed326 jed326 self-assigned this Feb 7, 2024
@jed326
Copy link
Collaborator

jed326 commented Feb 7, 2024

The NPE is coming from the test itself here:

for (Terms.Bucket b1 : t1.getBuckets()) {
final Terms.Bucket b2 = t2.getBucketByKey(b1.getKeyAsString());
final Terms sub1 = b1.getAggregations().get("f2");
final Terms sub2 = b2.getAggregations().get("f2");

Where the terms agg is not returning an expected bucket. My first thought is that this could be related to the slice_size change for terms aggs and because of that we are getting different buckets, but will need to get a local reproduction to confirm.

Also it seems the failure is from 2.x branch instead of main so trying to reproduce there.

@reta
Copy link
Collaborator Author

reta commented Feb 7, 2024

Also it seems the failure is from 2.x branch instead of main so trying to reproduce there.

Thanks @jed326 , yeah the NPEs are from tests but apparently the expectations are not met anymore

@jed326
Copy link
Collaborator

jed326 commented Feb 7, 2024

Yeah from the shared logs it looks like basically we got a different result from the DEPTH_FIRST collect mode compared to the BREADTH_FIRST.
One hypothesis is that a background merge happened between the r1 and r2 queries and due to the slice_size change to terms aggregations a bucket that appeared in r1 did not get returned in r2. The term values are created with randomInt(1 << randomInt(7));, which I believe means there can be up to 128 unique keys. This means it's definitely possible that there are many unique terms with a low doc count and could be susceptible to this issue.

I've run this test locally 1000+ times with the test seed provided and 1000+ times on random test seeds and haven't seen any failures yet.

@jed326
Copy link
Collaborator

jed326 commented Feb 7, 2024

Looking at the results from the given test seed:

{
    "f1": {
        "doc_count_error_upper_bound": 4,
        "sum_other_doc_count": 152,
        "buckets": [{
            "key": 1,
            "doc_count": 60,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 16,
                "buckets": [{
                    "key": 1,
                    "doc_count": 12,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 3
                        }, {
                            "key": 1,
                            "doc_count": 2
                        }, {
                            "key": 3,
                            "doc_count": 2
                        }, {
                            "key": 16,
                            "doc_count": 2
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 6,
                            "doc_count": 1
                        }, {
                            "key": 119,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 0,
                    "doc_count": 11,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 2
                        }, {
                            "key": 4,
                            "doc_count": 2
                        }, {
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 3,
                            "doc_count": 1
                        }, {
                            "key": 5,
                            "doc_count": 1
                        }, {
                            "key": 8,
                            "doc_count": 1
                        }, {
                            "key": 66,
                            "doc_count": 1
                        }, {
                            "key": 78,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 2,
                    "doc_count": 8,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 3
                        }, {
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 6,
                            "doc_count": 1
                        }, {
                            "key": 8,
                            "doc_count": 1
                        }, {
                            "key": 39,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 6,
                    "doc_count": 3,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 31,
                            "doc_count": 1
                        }, {
                            "key": 46,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 5,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 13,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 11,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 50,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 11,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 7,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 0,
            "doc_count": 52,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 12,
                "buckets": [{
                    "key": 0,
                    "doc_count": 10,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 3,
                            "doc_count": 3
                        }, {
                            "key": 1,
                            "doc_count": 2
                        }, {
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 4,
                            "doc_count": 1
                        }, {
                            "key": 6,
                            "doc_count": 1
                        }, {
                            "key": 12,
                            "doc_count": 1
                        }, {
                            "key": 32,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 2,
                    "doc_count": 8,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 4
                        }, {
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 16,
                            "doc_count": 1
                        }, {
                            "key": 17,
                            "doc_count": 1
                        }, {
                            "key": 27,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 6,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 6,
                            "doc_count": 1
                        }, {
                            "key": 13,
                            "doc_count": 1
                        }, {
                            "key": 15,
                            "doc_count": 1
                        }, {
                            "key": 62,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 1,
                    "doc_count": 4,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 2
                        }, {
                            "key": 3,
                            "doc_count": 1
                        }, {
                            "key": 4,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 4,
                            "doc_count": 1
                        }, {
                            "key": 21,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 5,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 6,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 3,
                            "doc_count": 1
                        }, {
                            "key": 19,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 9,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 87,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 10,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 68,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 23,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 121,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 2,
            "doc_count": 31,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 9,
                "buckets": [{
                    "key": 0,
                    "doc_count": 7,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 2,
                            "doc_count": 3
                        }, {
                            "key": 8,
                            "doc_count": 1
                        }, {
                            "key": 14,
                            "doc_count": 1
                        }, {
                            "key": 22,
                            "doc_count": 1
                        }, {
                            "key": 32,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 1,
                    "doc_count": 5,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 2
                        }, {
                            "key": 2,
                            "doc_count": 2
                        }, {
                            "key": 29,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 2,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 5,
                            "doc_count": 1
                        }, {
                            "key": 8,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 32,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 3,
                            "doc_count": 1
                        }, {
                            "key": 11,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 9,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 7,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 8,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 7,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 9,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 11,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 12,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 4,
            "doc_count": 28,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 9,
                "buckets": [{
                    "key": 1,
                    "doc_count": 7,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 2
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 7,
                            "doc_count": 1
                        }, {
                            "key": 43,
                            "doc_count": 1
                        }, {
                            "key": 76,
                            "doc_count": 1
                        }, {
                            "key": 90,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 0,
                    "doc_count": 3,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 4,
                            "doc_count": 1
                        }, {
                            "key": 7,
                            "doc_count": 1
                        }, {
                            "key": 27,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 10,
                            "doc_count": 1
                        }, {
                            "key": 49,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 2,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 5,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 6,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 19,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 10,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 11,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 11,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 7,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 14,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 6,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 16,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 6,
            "doc_count": 18,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": [{
                    "key": 1,
                    "doc_count": 4,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 3,
                            "doc_count": 1
                        }, {
                            "key": 9,
                            "doc_count": 1
                        }, {
                            "key": 18,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 3,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 6,
                            "doc_count": 2
                        }, {
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 0,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 2,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 61,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 113,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 5,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 7,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 12,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 15,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 37,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 25,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 3,
            "doc_count": 13,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": [{
                    "key": 1,
                    "doc_count": 4,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 4,
                            "doc_count": 1
                        }, {
                            "key": 17,
                            "doc_count": 1
                        }, {
                            "key": 110,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 0,
                    "doc_count": 3,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 104,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 14,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 5,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 8,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 3,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 34,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 63,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 61,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 14,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 13,
            "doc_count": 10,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": [{
                    "key": 2,
                    "doc_count": 3,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 31,
                            "doc_count": 1
                        }, {
                            "key": 45,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 0,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }, {
                            "key": 4,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 1,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }, {
                            "key": 3,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 5,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 13,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 5,
            "doc_count": 9,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": [{
                    "key": 0,
                    "doc_count": 2,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 2,
                            "doc_count": 1
                        }, {
                            "key": 10,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 2,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 5,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 23,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 5,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 11,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 13,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 8,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 15,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 8,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 17,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 34,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 30,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 19,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 8,
            "doc_count": 9,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": [{
                    "key": 0,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 102,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 1,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 31,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 3,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 7,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 8,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 15,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 20,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 29,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 6,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 37,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 15,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }, {
            "key": 10,
            "doc_count": 8,
            "f2": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": [{
                    "key": 0,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 88,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 4,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 9,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 8,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 12,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 23,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 0,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 25,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 62,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 114,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 15,
                            "doc_count": 1
                        }]
                    }
                }, {
                    "key": 126,
                    "doc_count": 1,
                    "f3": {
                        "doc_count_error_upper_bound": 0,
                        "sum_other_doc_count": 0,
                        "buckets": [{
                            "key": 1,
                            "doc_count": 1
                        }]
                    }
                }]
            }
        }]
    }
}

The 10th bucket only has 8 docs and the sum_other_doc_count is 152 which means there are at least (152 / 8 = 19) other buckets not returned. It doesn't seem all that unlikely that if a background merge did happen between queries r1 and r2 then the results could change.

@jed326
Copy link
Collaborator

jed326 commented Feb 8, 2024

Added additional logging to the test and running it on repeat...no reproduced failure yet after 3000 iterations though.

@reta
Copy link
Collaborator Author

reta commented Feb 8, 2024

Added additional logging to the test and running it on repeat...no reproduced failure yet after 3000 iterations though.

Thanks @jed326 , I was trying to reproduce it locally and no luck so far as well, let's keep the issue open for some time, in case it pops up again, thank you

@jed326
Copy link
Collaborator

jed326 commented Feb 12, 2024

Ran this 10k times over the weekend and still didn't see any reproduction, agree with leaving this open for now.

If we do see re-occurrence I think we can consider increasing the shard_size of the requests to eliminate any variance coming from segment layout / merges.

@jed326 jed326 removed their assignment Feb 12, 2024
@getsaurabh02 getsaurabh02 moved this from 🆕 New to Later (6 months plus) in Search Project Board Aug 15, 2024
@sandeshkr419
Copy link
Contributor

Closing this issue since we haven't been seeing this test as flaky for a while and if it happens again then opensearch-ci-bot will open up the issue back automatically.

@github-project-automation github-project-automation bot moved this from Todo to Done in Concurrent Search Nov 27, 2024
@github-project-automation github-project-automation bot moved this from Later (6 months plus) to ✅ Done in Search Project Board Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flaky-test Random test failure that succeeds on second run Search:Aggregations Search Search query, autocomplete ...etc
Projects
Status: Done
Archived in project
Development

No branches or pull requests

5 participants