Comments (6)
@nihohit How about having a reserved channel for pubsub notification for cluster topology changes generated on each node? This would be similar to keyspace notifications.
A client needs to be connected to all of the nodes to receive the message(s) which I presume is fine.
from valkey.
I implemented this for single moved slot some years ago. A single moved slot is what you get when you scale, i.e. migrate slots between nodes, because migration is done one slot at a time. It is practical to send a notification with just this change in this case. It's basically the same information as a MOVED redirect. When moving N slots, clients need to update the slot mapping N times (if they do it on MOVED), multiplying the work clients have to do to keep updated. That's why I think it makes the most sense for this scenario. I can revive the PR if there is interest.
For other changes, such as many slots moved (failover) or new replica added or deleted, notifications can't include all the relevant information, so I excluded it. A very small notification would be useful, like "topology changed" or "replicas changed".
from valkey.
How about having a reserved channel for pubsub notification for cluster topology changes generated on each node? This would be similar to keyspace notifications.
That sounds reasonable, although I'm not sure what's the difference between a pubsub notification and just a push notification.
For other changes, such as many slots moved (failover) or new replica added or deleted, notifications can't include all the relevant information, so I excluded it. A very small notification would be useful, like "topology changed" or "replicas changed".
I'm not sure what's "all of the relevant information", but as a client maintainer, I'd appreciate if the message contained as much of the relevant information.
from valkey.
A pubsub channel is used for other things like client-side caching and keyspace notifications. It's possible to use RESP2. There is already the syntax to subscribe, so it can be done without adding a new command.
from valkey.
A pubsub message has a fixed layout as (pseudo-JSON) ["message", "channel", "payload"]
or if psubscribe is used ["pmessage", "pattern", "channel", "payload"]
, so the payload is just a string. It can be regarded as a limitation, but that's anyway why I formatted it just like a redirect on the form "MOVED slot host:port", so maybe clients can reuse code for redirect parsing...
from valkey.
A pubsub channel is used for other things like client-side caching and keyspace notifications
Ah, that explains it. I assume that it's the same mechanism as pubsub channels on the server side. On our client side these are handled differently from "proper" pubsub messages :)
from valkey.
Related Issues (20)
- [NEW] Handle spamming of custom LUA error messages in the INFO ERRORSTATS section with continued tracking of non LUA errors stats HOT 9
- Introduce PR templates HOT 3
- Hoping for Valkey "Cluster" architecture option HOT 3
- [NEW] add a management-port HOT 13
- [BUG] - Coverage target fails to build because of failing test HOT 4
- [NEW] Add eol data to endoflife.date HOT 2
- [NEW] Add keyspace_hit_ratio metric in info stats
- [Feature-Request]: Cross-Slot Command Execution in ValKey Cluster HOT 2
- [NEW] Support for Active/Active replication HOT 6
- [NEW] Compacting the output of topology commands for for fragmented clusters HOT 1
- Revert mmap_rnd bits back to default value
- [NEW] Support different bind addresses for plain TCP and TLS port
- Deprecate MacOS 11 build target
- New MPUBLISH command to publish multiple messages. HOT 5
- Replace CentOS 7 image with CentOS Stream 9 HOT 1
- Handling edge cases on connSet(Read/Write)Handler
- Validate format of YAML files HOT 2
- [Improvement][Cluster Mode] Remove Unowned Keys After Loading Persistence Files At Server Startup HOT 2
- [NEW] Limit maximum size on disk of AOF files. Avoid disk full, long load times.
- [BUG] Inaccurate total_active_defrag_time calculation?
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 valkey.