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
PagingPredicate, - returning duplicated elements, resulting in infinite loop. #3047
Comments
related failing tests on master. It seems the issue must be forward ported to the master branch.
|
Maybe the method -- "hashCode()"(it's called in the "SortingUtil.compare()".), inheriting from the "Object", is the cause of the incorrect result when using the "PagingPredicate". (The hash code of the same "anchor" in the same "PagingPredicate" will be different at two query requests.) |
The issue is about the wrong hashcode comparison. Suppose that Normally "i1 < i2", but if we use "i1 - i2" for comparison So, if we use "i1 - i2" for comparison, since result is greater than 0, So comparison must be like this ...
int result = compareIntegers(comparable1.hashCode(), comparable2.hashCode());
...
private static int compareIntegers(int i1, int i2) {
// "return i1 - i2" is not good way for comparison
if (i1 > i2) {
return +1;
} else if (i2 > i1) {
return -1;
} else {
return 0;
}
} Please see PR #3334 |
@serkan-ozal @mdogan looks like paging predicate is still producing duplicate results |
…f there is no comparator)
…se of non-comparable)
Closed by #3427 |
related to #9968 |
RP #3042 show Junit test for this issue.
issue first discovered while making a stabilizer test, around queries and indexes.
looks like range predicates, run on a map with Ordered Indexes, don't work as expected
The text was updated successfully, but these errors were encountered: