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

Fix segmentInfos replace doesn't set userData #12626

Merged
merged 9 commits into from
Nov 17, 2023

Conversation

Shibi-bala
Copy link
Contributor

@Shibi-bala Shibi-bala commented Oct 6, 2023

Description

The replace method of SegmentInfos does not overwrite the userData field. This PR fixes that bug. Relevant issue is opened here.

This closes #12637

@MarcusSorealheis
Copy link
Contributor

Hi @Shibi-bala and great to see you here. Let's sync up this week and maybe we can help move this PR forward. It's a good catch, so thank you.

@@ -1996,6 +1996,41 @@ public void testGetCommitData() throws Exception {
dir.close();
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

It was the case that Lucene unit tests preferred to avoid the @Test annotation, going instead with the JUnit 3 convention where public methods whose name start with test... would indicate test methods.

I think the annotation on testGetCommitData() above must have slipped through (11 years ago).

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking through the other tests, I think this is an opportunity to clean up that @Test annotation from testGetCommitData() to make the whole test class consistent (since that's the only other occurrence of @Test here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good callout, fixed

@Shibi-bala
Copy link
Contributor Author

Kind of confused why this check is failing. This was never changed and I've tried merging.

1```
. ERROR in /home/runner/work/lucene/lucene/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java (at line 49)
import org.apache.lucene.index.SerialMergeScheduler;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Task :lucene:test-framework:ecjLintMain FAILED
The import org.apache.lucene.index.SerialMergeScheduler is never used

@uschindler
Copy link
Contributor

Have you merged in the latest main branch, so this PR is uptodate? This could be an issue which already existed when the PR was created.

@Shibi-bala
Copy link
Contributor Author

@uschindler Ah I needed to re-sync my forked repo 😅

@MarcusSorealheis
Copy link
Contributor

Looks good now.

@Shibi-bala
Copy link
Contributor Author

@uschindler hey, thanks for the approval! Read the contributing guidelines, but not entirely sure how to get permissions to merge this PR.

@uschindler
Copy link
Contributor

uschindler commented Nov 17, 2023

You can't do it.

Please add a Changes entry unter the 9.9 section, commit it to branch and I will merge and Backport your PR.

I am just away from my computer at moment, sorry for the delay.

@uschindler uschindler added this to the 9.9.0 milestone Nov 17, 2023
@uschindler uschindler self-assigned this Nov 17, 2023
@MarcusSorealheis
Copy link
Contributor

@Shibi-bala It's here:

======================== Lucene 9.9.0 =======================

You need to include your user and the GitHub user(s) that reviewed it/assisted as seen in the other entries.

@Shibi-bala
Copy link
Contributor Author

Made the changes. Thanks @uschindler @MarcusSorealheis @msfroh 😁

@uschindler uschindler merged commit 6db0913 into apache:main Nov 17, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segmentInfos.replace() doesn't set userData
4 participants