Skip to content
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 replicaof command flag #1381

Closed
ut0mt8 opened this issue Jun 9, 2023 · 7 comments · Fixed by #1583
Closed

Add replicaof command flag #1381

ut0mt8 opened this issue Jun 9, 2023 · 7 comments · Fixed by #1583
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ut0mt8
Copy link

ut0mt8 commented Jun 9, 2023

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
Copy link
Collaborator

romange commented Jun 12, 2023

Lets make it --replicaof=foo:port

@romange romange added the enhancement New feature or request label Jun 12, 2023
@romange romange changed the title Add slaveof command flag Add replicaof command flag Jun 12, 2023
@romange romange added the good first issue Good for newcomers label Jun 12, 2023
@royjacobson
Copy link
Contributor

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
Copy link

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

@ut0mt8
Copy link
Author

ut0mt8 commented Jun 20, 2023

Ideally I think the both seems needed 👍

@adiholden
Copy link
Collaborator

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

@romange
Copy link
Collaborator

romange commented Aug 1, 2023

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

@talbii
Copy link
Contributor

talbii commented Aug 1, 2023

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 added a commit that referenced this issue Aug 9, 2023
* introduce `--replicaof` flag

Closes #1381.

The behvaiour of `--replicaof` is similar to `REPLICAOF`. On startup, the instance continuously attempts to connect to master. Stop using the normal `REPLICAOF NO ONE` command.

The flag expects format `<IPv4/host>:<port>` or `[<IPv6>]:<port>`.

---------

Signed-off-by: talbii <ido@dragonflydb.io>
Signed-off-by: talbii <41526934+talbii@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants