Comments (5)
By the look of things we already thought about handling keyless commands by selecting a random client, but the error is getting thrown before ever reaching there.
My guess is that something changed and inadvertently made that code redundant, but I'm not sure. I'll try and figure out what the intention was with that change, because it should hopefully make handling TIME
a fairly minor change
from redis-clustr.
Hi @lukemcgregor, that's a good shout. I think originally we didn't have support for keyless commands because most of them (e.g. anything CONFIG
or CLUSTER
-related) don't make sense to run against a cluster (you'd most likely want to be issueing them against specific individual servers)
TIME, though, could make sense, at least to make it so it doesn't error. Although it should probably come with a word of caution that the nodes in your cluster won't necessarily report exactly the same time, so you probably shouldn't rely on it for absolute accuracy. I'll make a PR and this can go into a new release
(out of curiosity, do you have a particular use-case for the TIME
command? e.g. is it something that might break if we select a shard at random vs always addressing shard 0?)
from redis-clustr.
@jbt Yeah I'm not to sure about all the use cases for TIME
, my particular one was that I had it inside a health check to check the downstream redis system was running. When I switched over to a clustered version of redis I got this error.
Picking the right instance will make this a bit weird. You're totally right that each will return subtly different time and I can imagine this being useful for some applications. Maybe instead the command should return an array of times from every instance or perhaps take an optional argument to select a specific node? Might be worth checking out other language libraries and what they do here as they might have a good answer?
from redis-clustr.
So as it turns out, that line of code has flagged up another rather fun bug: #26. So thanks for prompting me to dig into this, I'll try and fix the two together
from redis-clustr.
Just published v1.6.0 with the changes for #26 and this. Things like TIME seem to behave now as far as I can tell, routing to a random node as always intended.
from redis-clustr.
Related Issues (20)
- config command is an object not a function HOT 2
- redis-clustr monitor mode crashes HOT 1
- redis client.duplicate() missing HOT 3
- Does not redis-clustr support typescript? HOT 2
- Commands with movable keys shouldn't select random nodes
- Why is "MOVED" throwing an exception instead of following it? HOT 3
- Error "couldn't get client" on keys command HOT 3
- issue to connect to elasticache HOT 10
- How to flush all nodes in cluster? HOT 1
- subscribe errors after 'ready' event
- Multi-key commands support
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
- How to define master and slave in the servers config
- pub.send_command is not a function
- uncaughtException: TypeError: Cannot read property 'address' of undefined
- Requests fail when slaves = 'never' and redis-clustr connects to slave first
- redis clustr issue with scan command
- couldn't get slot allocation HOT 3
- fullReady to be added to documentation
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 redis-clustr.