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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
