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

Relax < check to <= for NodeToolGossipInfoTest #819

Closed
wants to merge 1 commit into from

Conversation

driftx
Copy link
Contributor

@driftx driftx commented Nov 12, 2020

No description provided.

Copy link
Contributor

@beobal beobal left a comment

Choose a reason for hiding this comment

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

LGTM. Would you mind also fixing the test name on commit please?

blambov pushed a commit to blambov/cassandra that referenced this pull request Nov 27, 2023
…found (apache#819)

This PR fixes two issues. Together, the two issues effectively cancel each other out and work correctly on `vsearch`, however, when we merge the switch proposed in apache#801, we do not get the cancellation.

The problem is that for range queries the right bound of an AbstractBound can be less than the left bound, and this matters when finding the `floor` for a token, since our definition of floor does not treat numbers as a ring. The current code works because when the PK does not have a floor, ReversedTrieRangeIterator returns Long.MAX_VALUE, and we get the correct range of sstable row ids.

The solution:

* Update ReversedTrieRangeIterator to return -1, and adopt the behavior we will see in apache#801.
* Update `V2VectorIndexSearcher#bitsOrPostingListForKeyRange` so that it correctly handles the right boundary as the minimum token.

This change is covered by the `VectorTypeTest#rangeSearchTest`, which fails if we only implement the first bullet of the solution.

Additionally, note that we have have the same usage pattern for `isMinimum` on the right bound in the vector `VectorMemtableIndex#search` method.

https://github.com/datastax/cassandra/blob/49a51690caca180fc33bd49c7b95cfc8ee0627f3/src/java/org/apache/cassandra/index/sai/disk/vector/VectorMemtableIndex.java#L170-L171
ekaterinadimitrova2 pushed a commit to ekaterinadimitrova2/cassandra that referenced this pull request Jun 3, 2024
…found (apache#819)

This PR fixes two issues. Together, the two issues effectively cancel each other out and work correctly on `vsearch`, however, when we merge the switch proposed in apache#801, we do not get the cancellation.

The problem is that for range queries the right bound of an AbstractBound can be less than the left bound, and this matters when finding the `floor` for a token, since our definition of floor does not treat numbers as a ring. The current code works because when the PK does not have a floor, ReversedTrieRangeIterator returns Long.MAX_VALUE, and we get the correct range of sstable row ids.

The solution:

* Update ReversedTrieRangeIterator to return -1, and adopt the behavior we will see in apache#801.
* Update `V2VectorIndexSearcher#bitsOrPostingListForKeyRange` so that it correctly handles the right boundary as the minimum token.

This change is covered by the `VectorTypeTest#rangeSearchTest`, which fails if we only implement the first bullet of the solution.

Additionally, note that we have have the same usage pattern for `isMinimum` on the right bound in the vector `VectorMemtableIndex#search` method.

https://github.com/datastax/cassandra/blob/49a51690caca180fc33bd49c7b95cfc8ee0627f3/src/java/org/apache/cassandra/index/sai/disk/vector/VectorMemtableIndex.java#L170-L171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants