You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "git-hulk (via GitHub)" <gi...@apache.org> on 2023/06/05 16:32:54 UTC

[GitHub] [incubator-kvrocks] git-hulk opened a new issue, #1484: Don't allow to slaveof itself or its replica

git-hulk opened a new issue, #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   Currently, we didn't check if the master is itself or in its replica set, so it may cause a replication loop like the below:
   
   ```
   127.0.0.1:6666> SLAVEOF 127.0.0.1 6666
   OK
   127.0.0.1:6666> info replication
   # Replication
   role:slave
   master_host:127.0.0.1
   master_port:6666
   master_link_status:up
   master_sync_unrecoverable_error:no
   master_sync_in_progress:0
   master_last_io_seconds_ago:2
   slave_repl_offset:0
   slave_priority:100
   connected_slaves:1
   slave0:ip=127.0.0.1,port=6666,offset=0,lag=0
   master_repl_offset:0
   ```
   
   
   
   ### Solution
   
   Check the master host/port before sending the command.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] uds5501 commented on issue #1484: Don't allow to slaveof itself or its replica

Posted by "uds5501 (via GitHub)" <gi...@apache.org>.
uds5501 commented on issue #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484#issuecomment-1579849391

   I am working on it, should be able to raise an MR in a couple of days.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] jihuayu commented on issue #1484: Don't allow to slaveof itself or its replica

Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on issue #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484#issuecomment-1578018689

   @git-hulk  If I use `SLAVEOF 127.0.0.2 6666`, how can it check that the master is itself? Or if I send traffic with IP address 172.20.100.2 to the server where the master is located and use `SLAVEOF 172.20.100.2 6666`, how can it check?
   
   Judging based on the IP address and port is not accurate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #1484: Don't allow to slaveof itself or its replica

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on issue #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484#issuecomment-1579806171

   Hi @zevin02
   
   Thanks for your attention.
   
   @uds5001 has already taken this in community slack channel, will ping back if he has no time to do that.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #1484: Don't allow to slaveof itself or its replica

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on issue #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484#issuecomment-1578054708

   @jihuayu Firstly, we don't promise it can recognize all conditions since the traffic device mapping is complex. What we can do is try our best to avoid this condition, so I think the below checks are enough:
   
   - if Kvrocks is listening on address 0.0.0.0, we parse the IP addresses from device and compare the master host and port
   - if Kvrocks is listening on the exact IP address, just compare the IP and Port directly


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #1484: Don't allow to slaveof itself or its replica

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on issue #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484#issuecomment-1579850558

   > I am working on it, should be able to raise an MR in a couple of days.
   
   Thanks for your efforts. No hurry, can do it while you're free.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] zevin02 commented on issue #1484: Don't allow to slaveof itself or its replica

Posted by "zevin02 (via GitHub)" <gi...@apache.org>.
zevin02 commented on issue #1484:
URL: https://github.com/apache/incubator-kvrocks/issues/1484#issuecomment-1579803630

   I think I can do it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk closed issue #1484: Don't allow to slaveof itself or its replica

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk closed issue #1484: Don't allow to slaveof itself or its replica
URL: https://github.com/apache/incubator-kvrocks/issues/1484


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org