-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Redis-cli gets RDB by RDB channel #13809
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
Conversation
|
Okay, this is interesting. Normally, slave will send Two things come to my mind,
@ShooterIT wdyt? |
|
@tezc thank you
|
it seems we don't have mechanism to block this way(slave sends |
You mean after replying +RDBCHANNELSYNC, if config changes to "disabled", master will still accept "replconf rdb-channel" ? Yes, currently, this is how it works. We are missing config checks.
Okay, good point. Looks like we need to revisit this. Also, config change in between makes it a bit complicated. One extra scenario: After receiving |
|
I don't find issues, both master and replicas works well when disk-based.
maybe we don't need to prevent this way, we don't change protocol on rdb channel which is the same as full resynchronization as before. |
|
I just have one concern, currently it applies to diskless repl. Assume for some reason (maybe we realized a bug) and we decide not to use delivery from fork. So, we set "repl-rdb-channel" config disabled on master. Now, if slave directly sends "replconf rdb-channel 1", master will still deliver it from fork. It feels like slave is controlling master's behavior, basically it overrides config on master. So, for this reason, maybe adding a simple config check to "replconf rdb-channel 1" is a good idea. Maybe, we should not care at all.. Wdyt? |
I think your concern makes sense. when we check |
|
I think master can just ignore, it wouldn't set |
|
ok, added check. now we try best to avoid |
Yes, it should work. Btw, still, I feel like we better let master to decide whether it wants to deliver RDB in the fork (not requiring client to send "replconf rdbchannel 1"). This way, we also avoid error message when cli is run against older redis versions. Currently, older redis versions will return error to "replconf rdbchannel 1". I see it is not fatal but we'll print an error message, it may be confusing. |
|
so actually we don't need to provide |
Yes. Master can decide itself whether it wants to use this optimization. e.g. if "rdb-channel-repl" is enabled, it delivers directly from fork when slave is "rdb-only". Slave does not have to declare "replconf rdbchannel 1". |
Co-authored-by: Ozan Tezcan <ozantezcan@gmail.com>
|
@ShooterIT Seems like there was an empty rdb file |
|
oh, yes, @collinfunk thank you, let me remove it |
#13809 accidentally submitted a tmp rdb file, so delete it
|
@ShooterIT Thanks! |
Now we have RDB channel in #13732, child process can transfer RDB in a background method, instead of handled by main thread. So when redis-cli gets RDB from server, we can adopt this way to reduce the main thread load.