-
Notifications
You must be signed in to change notification settings - Fork 978
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
Cursor based operations not working properly with ReadFrom = ANY #2926
Comments
@tishun |
Will try to take a look this week, apologies for the delay |
Hey @EMDavl , /**
* Setting to read from any node.
*
* @since 5.2
*/
public static final ReadFrom ANY = new ReadFromImpl.ReadFromAnyNode(); Am I correct to assume you want to both use |
Hello again, I've taken the liberty of modifying your code and it now reads all the values: Set<String> set = new HashSet<>();
ScoredValueScanCursor<String> cursor = null;
do {
if (cursor == null) {
cursor = sync.zscan(zsetName, ScanCursor.of("0"), ScanArgs.Builder.limit(1000));
} else {
cursor = sync.zscan(zsetName, ScanCursor.of(cursor.getCursor()), ScanArgs.Builder.limit(1000));
}
for (ScoredValue<String> value : cursor.getValues()) {
set.add(value.getValue());
}
} while (!cursor.isFinished()); Does that help? |
Hello! Unfortunately, the solution you suggested didn't resolve the issue. I replaced it with what I had in my MRE, and in each of the three test runs, only part of the records were read. Perhaps you could share how you tested its functionality?
Initially, our project was configured with the
Not necessarily; the main requirement is that the SCAN family of commands, when used with |
Greetings again,
What I did is deployed an new empty cluster and run the code, with the change I suggested EMDavl/cursor-bug#1 This resulted in the (for me) expected result being output: While without my change the result was random, but always less than 10000, for ex.:
The issue is that the order in which you check
You are correct! I was mistakingly assuming the driver does not follow up on the contract, but in fact it does, even when the |
Thank you very much for your time and clarifications. |
Apologies for the delay, the last few weeks have been quite busy, and the next couple don't promise to be any freer. I'll reply to the thread as soon as I'm able to double-check everything |
Sure, I will be happy to help if there is still something unclear or you discover an issue with the driver |
Bug Report
Current Behavior
Hello!
We have encountered the following problem - when using zscan with Redis Cluster and the ReadFrom parameter set to ANY, consecutive requests may be sent to different nodes. Because of this, the response does not comply with the guarantees provided by Redis regarding SCAN family operations. The response may contain duplicate values, and some values may be missing altogether.
Small example - https://github.com/EMDavl/cursor-bug
Expected behavior/code
SCAN family requests return correct values with the ReadFrom parameter set to ANY when the library is used with Redis Cluster. Requests are sent to the same node.
Environment
Possible Solution
Send requests related to scan based operations to the same node untill iteration ends
The text was updated successfully, but these errors were encountered: