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

show_slave_info_with_log #1382

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/replication.c
Expand Up @@ -411,6 +411,9 @@ int masterTryPartialResynchronization(redisClient *c) {

/* SYNC ad PSYNC command implemenation. */
void syncCommand(redisClient *c) {
char ip[REDIS_IP_STR_LEN];
int port;

/* ignore SYNC if already slave or in monitor mode */
if (c->flags & REDIS_SLAVE) return;

Expand All @@ -430,7 +433,14 @@ void syncCommand(redisClient *c) {
return;
}

redisLog(REDIS_NOTICE,"Slave asks for synchronization");

if (anetPeerToString(c->fd,ip,sizeof(ip),&port) == -1) {
redisLog(REDIS_NOTICE,"Slave asks for synchronization");
} else {
redisLog(REDIS_NOTICE,"Slave(%s:%d) asks for synchronization",
ip, c->slave_listening_port);
}


/* Try a partial resynchronization if this is a PSYNC command.
* If it fails, we continue with usual full resynchronization, however
Expand Down