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

Use Arrays.compareUnsigned in IDVersionSegmentTermsEnum and OrdsSegmentTermsEnum. #13782

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vsop-479
Copy link
Contributor

Description

Description
This change similars to #13252.

@vsop-479
Copy link
Contributor Author

@uschindler
Please take a look when you get a chance.

lucene/CHANGES.txt Outdated Show resolved Hide resolved
@vsop-479
Copy link
Contributor Author

@jpountz
I think this check failure relats to 5045d3c .

@jpountz
Copy link
Contributor

jpountz commented Sep 13, 2024

Indeed it likely does, can you merge main back into your branch?

Copy link
Contributor

@uschindler uschindler left a comment

Choose a reason for hiding this comment

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

Hi,
We had others like this in former PRs (e.g., #13252). As this old code looks like copy pasted over and over, can we find other occurrences using some regex searches?

@uschindler
Copy link
Contributor

Backport or not?

@jpountz
Copy link
Contributor

jpountz commented Sep 13, 2024

I would backport as it looks pretty safe, though I doubt we have anyone using this postings format, so it likely doesn't matter much in practice.

@vsop-479
Copy link
Contributor Author

vsop-479 commented Sep 13, 2024

can you merge main back into your branch?

Merged.

can we find other occurrences using some regex searches?

I searched code with final int targetUptoMid = targetUpto which these iterating compare start with.
There are only two places remains in org.apache.lucene.backward_codecs.lucene40.blocktree.SegmentTermsEnum now, since this is a bakward class, I am not sure we should modify it.

@uschindler
Copy link
Contributor

I would backport as it looks pretty safe, though I doubt we have anyone using this postings format, so it likely doesn't matter much in practice.

The we should move the changes entry. Do we have a corresponding 9.x section already?

@vsop-479
Copy link
Contributor Author

The we should move the changes entry. Do we have a corresponding 9.x section already?

We already have a similar change entry for #13252 under 9.11.0, so we should move this change entry?

@uschindler
Copy link
Contributor

The we should move the changes entry. Do we have a corresponding 9.x section already?

We already have a similar change entry for #13252 under 9.11.0, so we should move this change entry?

Yes, let's merge them an list both PRs.

@vsop-479
Copy link
Contributor Author

Ok, I will do it.

@vsop-479
Copy link
Contributor Author

let's merge them an list both PRs.

I merged them into one entry.

@vsop-479
Copy link
Contributor Author

vsop-479 commented Sep 14, 2024

can we find other occurrences using some regex searches?

Hmm, I also find some suffix's loop comparing in IDVersionSegmentTermsEnumFrame and OrdsSegmentTermsEnumFrame, similar to SegmentTermsEnumFrame, these code maybe could replaced by Arrays#compareUnsigned too.

But, before that I find we attempt to load sub block when scanning a leaf block in IDVersionSegmentTermsEnumFrame#scanToTermLeaf: #13786.

@vsop-479
Copy link
Contributor Author

can we find other occurrences using some regex searches?

I replaced loop compare suffixe with Arrays#compareUnsigned in IDVersionSegmentTermsEnumFrame and OrdsSegmentTermsEnumFrame.

@vsop-479
Copy link
Contributor Author

I replaced loop compare suffixe with Arrays#compareUnsigned in IDVersionSegmentTermsEnumFrame and OrdsSegmentTermsEnumFrame.

@jpountz It seems you implemented the same thing in SegmentTermsEnumFrame. Please take a look when you get a chance.

Copy link

github-actions bot commented Oct 8, 2024

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Oct 8, 2024
@vsop-479 vsop-479 requested a review from jpountz October 10, 2024 02:35
@github-actions github-actions bot removed the Stale label Oct 11, 2024
Copy link

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Oct 25, 2024
@vsop-479
Copy link
Contributor Author

Hello @jpountz , Please take a look when you get a chance.

@github-actions github-actions bot removed the Stale label Nov 14, 2024
Copy link

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Nov 28, 2024
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.

3 participants