Comments (11)
you are right
I agree with you
from lettuce.
io.lettuce.core.masterreplica.ReadOnlyCommands. READ_ONLY_COMMANDS contains geo like command
from lettuce.
GEORADIUS cannot be executed on readonly slave node #4084
from lettuce.
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?
from lettuce.
I create a new class, and use reflection to modify the field ReadOnlyCommands. READ_ONLY_COMMANDS before my custom LettuceClientConfigurationBuilderCustomizer initialize
it works
however, i think is a bug in Lettuce, so i report it as a bug
from lettuce.
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
from lettuce.
Can you elaborate more on why you need to remove them from the list in this way?
Is some part of your code depending on iterating over the list?
I assume you can't make a check there?
I agree that the GEORADIUS
and GEORADIUSBYMEMBER
commands do not belong to this list and we need to remove them. The other GEO* commands in the list should be read-only so they need not be removed.
from lettuce.
Beacause I have not fund a way to modify or extend the ReadOnlyCommands.isReadOnlyCommand method
So I use a bad way to resolve it
I have not test all the geo like commands, so I remove all the geo like commands, it is not exact
from lettuce.
Perhaps Eval should also be removed
from lettuce.
Hi @tishun, @kennethfan I checked and removed some not read-only commands on the list. Please help review 🙇
from lettuce.
Beacause I have not fund a way to modify or extend the ReadOnlyCommands.isReadOnlyCommand method So I use a bad way to resolve it I have not test all the geo like commands, so I remove all the geo like commands, it is not exact
There is a way to do that, see #2568 (comment)
Perhaps Eval should also be removed
This has been fixed since 6.3.x
from lettuce.
Related Issues (20)
- Hash Field Expiration Support HOT 1
- SSL FULL verify seed connection, but only CA verify for cluster node connections
- Getting the keys from cache returns the wrong amount in cluster mode with replica enabled. HOT 1
- Is client side caching enabled by default in lettuce? If yes, Is there a way to not do client side caching in lettuce? HOT 1
- Seeing Warning Logs :: Cannot refresh Redis Cluster topology in 6.2.6.RELEASE HOT 4
- After turning on topology refresh, lettuce log is written inside rocketmq-client.log. HOT 4
- Lettuce client reconnecting frequently HOT 1
- Custom command with Lettuce occurs UnsupportedOperationException HOT 1
- Stateful redis cluster pubsub is not working HOT 1
- Why does lecttuce send lua script load command to all nodes (including replicas) in redis cluster? HOT 4
- `DefaultClientResources.dnsResolver(DnsResolver resolver)` should be marked as deprecated.
- ClusterTopologyChangedEvent Timing Issue
- Provide a convenience method to support reading of last message from stream
- use with gateway,but something throw io.lettuce.core.output.ValueOutput does not support set(long) HOT 10
- Adjusting disconnectedBehavior Option to Prevent Timeout When Redis Shutdown HOT 1
- Pool exhausted, Java 21 and Virtual Threads HOT 2
- AWS RedisCache replica Failover can not be resolved
- Release Lettuce 7.0.0.RELEASE
- Thread blocked when using one global instance of ClientResources but repeatedly opening and closing connections
- Prepare 6.4.0 branch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lettuce.