-
Notifications
You must be signed in to change notification settings - Fork 16
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
Redis pubsub support #645
Redis pubsub support #645
Conversation
3858406
to
4a53481
Compare
9fb49b7
to
42ae8e3
Compare
I just realized that this PR doesnt handle the case explained here: #537 (comment)
When it should return:
I think we can still reasonably land the PR as is and fix this is in a follow up. |
Oh another case we arent handling yet is: |
Possible fix 1A fix for both of these problems is to send "message", "subscribe" and "unsubscribe" responses down the pushed messages chain not just "message". However!
may be processed as:
This is because the pubsub/nonpubsub responses to batch2 are nonordered due to going down separate chains Oh.
may be processed as:
I guess this doesnt apply to fix 1 but does apply to fix 2? If we remove any "message"'s that occur in the same batch as a corresponding "unsubscribe" will that avoid any instances of this issue? Possible fix 2Alter the redis Frame so that we can store all the "subscribe" and "unsubscribe" responses batched into a single response. |
Alright this is my plan to fix the discovered issues: Fix response/request syncgroup subscribe and unsubscribe responses into a single message. Either:
Fix "message" appearing after leaving pubsub modeAdd a field to Wrapper called pushed_messages_state which contains an enum: enum PushedMessagesState {
SetDrop,
SetProcess,
MaintainPreviousState,
} server.rs then uses this field to maintain a Remaining issueThere is still the issue of "message"s arriving while in pubsub mode but after they were specifically unsubscribed.
ConclusionThese changes will be quite invasive so I propose we continue with the review, land this PR and then attempt these changes in follow up PRs. |
Shouldn't all client requests still just traverse the normal request chain? Which would stop the out of order problem? My read was that these commands would head down the normal chain E.g.
I thought the unsubscribe command would head down the same chain as the subscribe. It's only the "subscription" messages (not commands) that go down the other chain (or at least in my mind we should do it that way, if we don't)? Give that those are all client requests, the order they are issued will be maintained. There may be some subscribbed messages that interleave that. But |
A quick refresher on terms:
Yep, that is how I have currently implemented it and keeping it like that seems to be the best solution.
The problem is not the ordering of responses but the ordering of "message"s relative to the responses.
and shotover may reorder this to:
Which is very incorrect as the "message" will be interpreted as the response to the next request as the "message" was received after we left subscription mode. Oh. |
c884754
to
1500ea0
Compare
Closes #491 (We now ensure we read a response for every request we send out, which fixes the hang)
Implements the
transform_subscribe
idea described in #541This only implements support for RedisSinkSingle.
I will investigate RedisSinkCluster later on, not sure what will be involved for that one.