Skip to content

Fix TopGroupsCollectorManager ignoring withinGroupOffset#15995

Merged
javanna merged 4 commits into
apache:mainfrom
gaobinlong:fixTopGroups
May 4, 2026
Merged

Fix TopGroupsCollectorManager ignoring withinGroupOffset#15995
javanna merged 4 commits into
apache:mainfrom
gaobinlong:fixTopGroups

Conversation

@gaobinlong
Copy link
Copy Markdown
Contributor

Description

When testing the newly introduced TopGroupsCollectorManager in this PR, found that TopGroupsCollectorManager hardcoded 0 as the withinGroupOffset when calling TopGroups.merge(), causing pagination within groups to be silently ignored, this PR adds withinGroupOffset field and constructor parameter into TopGroupsCollectorManager, also modify the unit test to make it cover non-zero withinGroupOffset case.

In addition, simplify the TopGroupsCollectorManager.reduce() method.

Signed-off-by: Binlong Gao <gbinlong@amazon.com>
Signed-off-by: Binlong Gao <gbinlong@amazon.com>
@github-actions github-actions Bot added this to the 10.5.0 milestone Apr 29, 2026
@gaobinlong
Copy link
Copy Markdown
Contributor Author

Hi @javanna , could you help to review this PR? Thanks!

Copy link
Copy Markdown
Contributor

@javanna javanna left a comment

Choose a reason for hiding this comment

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

I left a couple of small comments, LGTM otherwise

gaobinlong added 2 commits May 2, 2026 16:01
Signed-off-by: Binlong Gao <gbinlong@amazon.com>
Signed-off-by: Binlong Gao <gbinlong@amazon.com>
@gaobinlong
Copy link
Copy Markdown
Contributor Author

Thanks @javanna , addressed your comments, and made some change to honor the newly merged PR targeting for version 11, so if this PR will be backported to 10.x, may have some conflict, if need help, I can create a backport PR manually.

@javanna javanna merged commit dc190df into apache:main May 4, 2026
13 checks passed
javanna pushed a commit that referenced this pull request May 4, 2026
When testing the newly introduced TopGroupsCollectorManager in #15603, found that TopGroupsCollectorManager hardcoded 0 as the withinGroupOffset when calling TopGroups.merge(), causing pagination within groups to be silently ignored, this PR adds withinGroupOffset field and constructor parameter into TopGroupsCollectorManager, also modify the unit test to make it cover non-zero withinGroupOffset case.

In addition, simplify the TopGroupsCollectorManager.reduce() method.

Signed-off-by: Binlong Gao <gbinlong@amazon.com>
@javanna
Copy link
Copy Markdown
Contributor

javanna commented May 4, 2026

Merged and backported, thanks @gaobinlong !

javanna added a commit that referenced this pull request May 4, 2026
The collectors arraylist is no longer needed. This commit removes it.
sgup432 pushed a commit to sgup432/lucene that referenced this pull request May 4, 2026
When testing the newly introduced TopGroupsCollectorManager in apache#15603, found that TopGroupsCollectorManager hardcoded 0 as the withinGroupOffset when calling TopGroups.merge(), causing pagination within groups to be silently ignored, this PR adds withinGroupOffset field and constructor parameter into TopGroupsCollectorManager, also modify the unit test to make it cover non-zero withinGroupOffset case.

In addition, simplify the TopGroupsCollectorManager.reduce() method.

Signed-off-by: Binlong Gao <gbinlong@amazon.com>
sgup432 pushed a commit to sgup432/lucene that referenced this pull request May 4, 2026
The collectors arraylist is no longer needed. This commit removes it.
@dweiss
Copy link
Copy Markdown
Contributor

dweiss commented May 5, 2026

This commit broke tests on branch_10x - they can be reproduced.

gradlew :lucene:grouping:test --tests "org.apache.lucene.search.grouping.TestTermGroupSelector.testShardedGrouping" -Ptests.jvms=4 -Ptests.jvmargs= -Ptests.seed=49B2CF2F7719604F -Ptests.multiplier=2 -Ptests.useSecurityManager=true -Ptests.gui=true -Ptests.file.encoding=ISO-8859-1 -Ptests.vectorsize=512 -Ptests.forceintegervectors=true

I suspect it's a test problem somewhere but didn't look closely.

dweiss added a commit that referenced this pull request May 6, 2026
@dweiss
Copy link
Copy Markdown
Contributor

dweiss commented May 6, 2026

Seems like a test regression, I've fixed it by reverting what's on main.

@javanna
Copy link
Copy Markdown
Contributor

javanna commented May 6, 2026

Thanks @dweiss for fixing. I had merge conflicts when backporting and overlooked this test. Looks good now.

@gaobinlong
Copy link
Copy Markdown
Contributor Author

Thanks @dweiss @javanna !

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.

3 participants