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
georaduis command execute error when use ReadFrom.REPLICA_PREFERRED #2832
Comments
GEORADIUS cannot be executed on readonly slave node #4084 |
Oh man, what a mess ... Would using the GEORADIUS_RO work in your case? Do you have a solution to your problem? |
I create a new class, and use reflection to modify the field ReadOnlyCommands. READ_ONLY_COMMANDS before my custom LettuceClientConfigurationBuilderCustomizer initialize however, i think is a bug in Lettuce, so i report it as a bug |
public class ReadOnlyCommandsFix {
public static void fixRoCommands() throws NoSuchFieldException, IllegalAccessException {
Class clazz = ReadOnlyCommands.class;
Field field = clazz.getDeclaredField("READ_ONLY_COMMANDS");
field.setAccessible(true);
Set<CommandType> originReadOnlyCommands = (Set<CommandType>) field.get(null);
Set<CommandType> geoCommands = originReadOnlyCommands.stream()
.filter(e -> e.name().startsWith("GEO"))
.collect(Collectors.toSet());
originReadOnlyCommands.removeAll(geoCommands);
}
} this is my way to resolve it , it is ugly |
Can you elaborate more on why you need to remove them from the list in this way? I agree that the |
Beacause I have not fund a way to modify or extend the ReadOnlyCommands.isReadOnlyCommand method |
you are right |
Perhaps Eval should also be removed |
Bug Report
Current Behavior
Stack trace
Input Code
Input Code
Expected behavior/code
Environment
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: