dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Add replicaof command flag

Open ut0mt8 opened this issue 2 years ago • 4 comments

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)

ut0mt8 avatar Jun 09 '23 20:06 ut0mt8

Lets make it --replicaof=foo:port

romange avatar Jun 12 '23 04:06 romange

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)

royjacobson avatar Jun 12 '23 09:06 royjacobson

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

  • --replicaof=<ipv4>:port
  • --replicaof=[<ipv6>]:port

Kelvinyu1117 avatar Jun 20 '23 14:06 Kelvinyu1117

Ideally I think the both seems needed 👍

ut0mt8 avatar Jun 20 '23 17:06 ut0mt8

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

adiholden avatar Aug 01 '23 14:08 adiholden

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

romange avatar Aug 01 '23 16:08 romange

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 😸

talbii avatar Aug 01 '23 18:08 talbii