dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.64k stars 942 forks source link

Add replicaof command flag #1381

Closed ut0mt8 closed 1 year ago

ut0mt8 commented 1 year ago

as discussed on slack for starting replication from now we need to interact with the redis protocol to set the master. for auto starting replication we need something like --slaveof= flag.

(even if some ugly hack with systemd post start is possible)

romange commented 1 year ago

Lets make it --replicaof=foo:port

royjacobson commented 1 year ago

Lets make it --replicaof=foo:port

Just have to make sure we parse IPv6 addresses correctly (see https://softwareengineering.stackexchange.com/questions/311413/how-should-we-represent-an-ipv6-address-with-port-number-in-text)

Kelvinyu1117 commented 1 year ago

I can help to implement this task. What kind of argument format do we want to support? I can think of the followings:

ut0mt8 commented 1 year ago

Ideally I think the both seems needed 👍

adiholden commented 1 year ago

@talbii Note: we will need to support setting this flag from config set command

romange commented 1 year ago

@adiholden it's not clear what's the expected behavior for this. Lets first check internally if it's really required.

talbii commented 1 year ago

Sounds completely reasonable, also shouldn't be a problem to implement in code. I'll do this tomorrow.

Might be a bit problematic since REPLICAOF NO ONE should modify this config, but we'll see 😸