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)
- Release Lettuce 7.0.0.RELEASE
- Thread blocked when using one global instance of ClientResources but repeatedly opening and closing connections HOT 1
- Prepare 6.4.0 branch
- Application got io.lettuce.core.RedisCommandTimeoutException irregularly. HOT 3
- Does Lettuce use CLUSTER NODES instead of CLUSTER SLOTS to discover topology? HOT 3
- Caused by: io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required. HOT 3
- BugReport: ClusterTopologyRefreshTask is not shutdown when RedisClusterClient is shutdown
- Deadlock in SharedLock HOT 3
- `SCAN` not working when using a read-only user HOT 4
- Periodic cluster topology refresh blocks commands execution. HOT 5
- Provide a way to force the driver to reconnect HOT 1
- io.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1 HOT 4
- What are the differences and relationships between TimeoutOptions and defaultTimeout of AbstractRedisClient?
- Lettuce Drivers Fail on RedisHandshake when connecting to GCP Redis 7.2 HOT 1
- How to reduce memory footprint of RedisClient HOT 1
- Add support to get remaining TTL
- Flaky tests on the CI pipeline
- Improvements to the Redis connection/codec layer
- Distributed Lock with Lettuce HOT 1
- Cursor based operations not working properly with ReadFrom = ANY
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.