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

redis-cli: add connect master command when we are connecting replica and we want to connect master #9997

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Conversation

huangzhw
Copy link
Collaborator

@huangzhw huangzhw commented Dec 25, 2021

This PR adds connect master and connect replica to redis-cli to accommodate connect <host> <port>.

Sometimes I want to connect to master, so I connect to one node, execute
INFO replication to know whether this node is master.
If not, I execute connect master_host master_port.

I think it's useful to add connect master in redis-cli to automate this.

127.0.0.1:6380> connect master
127.0.0.1:6381> connect master
I'm already master

@oranagra oranagra added this to Needs triage in Triage via automation Dec 26, 2021
@oranagra oranagra moved this from Needs triage to To review in Triage Dec 26, 2021
Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems useful to me.

src/redis-cli.c Outdated Show resolved Hide resolved
src/redis-cli.c Outdated Show resolved Hide resolved
@oranagra oranagra moved this from To review to In review in Triage Dec 26, 2021
@huangzhw
Copy link
Collaborator Author

huangzhw commented Jan 1, 2022

Updated. A little concern about why roleCommand uses addReplyBulkLongLong to reply port.

@oranagra
Copy link
Member

oranagra commented Jan 2, 2022

@redis/core-team please approve or comment.

@oranagra oranagra moved this from In review to Awaits merge in Triage Jan 2, 2022
Copy link
Member

@itamarhaber itamarhaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaits merge
Triage
Awaits merge
Development

Successfully merging this pull request may close these issues.

None yet

4 participants