-
Notifications
You must be signed in to change notification settings - Fork 595
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
Add command "Client Capa subv2" to change behavior for SUBSCRIBE and SSUBSCRIBE commands: one call with only one response #962
base: unstable
Are you sure you want to change the base?
Conversation
cbdafa8
to
c4fff33
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #962 +/- ##
============================================
- Coverage 70.54% 70.52% -0.02%
============================================
Files 114 114
Lines 61644 61652 +8
============================================
- Hits 43488 43483 -5
- Misses 18156 18169 +13
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a design error from the beginning, and another design error when RESP3 was introduced, but it is too late to change it now.
This is a serious breaking change that will break all clients that support pubsub. This is very dangerous to do, considering there are many redis-compatible services out there and clients try to be compatible with not only valkey.
if (c->resp == 2) | ||
addReply(c, shared.mbulkhdr[number]); | ||
else | ||
addReplyPushLen(c, number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So with RESP3, this is still no normal in-band replies and one push message (instead of one per channel). This is still the main problem of [UN][P|S]SUBSCRIBE
IMO.
To fix this behaviour, SUBSCRIBE should return an in-band reply. Either the list of channels as an array or map-reply, or just +OK and send the channels as push.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not want to import this change in Valkey 8.0. I wish we could do this change on Valkey 8.X or 9 version. Error need to be correct, never late ^_^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we cannot fix it ever. Only maybe with a CLIENT CAPA or RESP4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree with this being a potentially significant breaking change. I think maybe CLIENT CAPA could fix it (or RESP4).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I update the design, add a new parameter for client capa command, but the parameter name is just temporarily. If you have better name, please let me know or we can discuss it in the meeting
c4fff33
to
3af8b90
Compare
30403a0
to
8bae942
Compare
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
8bae942
to
79f7352
Compare
Now for the command SUBSCRIBE and SSUBSCRIBE, if any client call with multiply channels, multiply responses come back.
It does not match with the Valkey command response logic, it causes client side to parse the response with extra effort on them. The problem exists long time.
Thus, to fix this design error, I add a new command parameter: client capa subv2
The command "client capa" is imported in Valkey 8, and I add a new parameter "subv2" for it
Note: subv2 is just a temporarily name, I have no idea which name is better, welcome any suggestion.
The update behavior as below: one call with one response
Note: for existing users, I think this is a break change. If any client chooses the behavior that one call with one response, the command "client capa subv2" can be called first.