Avoid differences between single thread and multi-thread
Former-commit-id: 848c5ad784d6437533f6c86663b81e41e06a11ea
This commit is contained in:
parent
b94b46a5ee
commit
c091050d4a
@ -834,10 +834,7 @@ int masterTryPartialResynchronization(client *c) {
|
|||||||
buflen = snprintf(buf,sizeof(buf),"+CONTINUE\r\n");
|
buflen = snprintf(buf,sizeof(buf),"+CONTINUE\r\n");
|
||||||
}
|
}
|
||||||
if (connWrite(c->conn,buf,buflen) != buflen) {
|
if (connWrite(c->conn,buf,buflen) != buflen) {
|
||||||
if (FCorrectThread(c))
|
freeClientAsync(c);
|
||||||
freeClient(c);
|
|
||||||
else
|
|
||||||
freeClientAsync(c);
|
|
||||||
return C_OK;
|
return C_OK;
|
||||||
}
|
}
|
||||||
psync_len = addReplyReplicationBacklog(c,psync_offset);
|
psync_len = addReplyReplicationBacklog(c,psync_offset);
|
||||||
@ -1674,10 +1671,7 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type)
|
|||||||
|
|
||||||
if (bgsaveerr != C_OK) {
|
if (bgsaveerr != C_OK) {
|
||||||
ul.unlock();
|
ul.unlock();
|
||||||
if (FCorrectThread(replica))
|
freeClientAsync(replica);
|
||||||
freeClient(replica);
|
|
||||||
else
|
|
||||||
freeClientAsync(replica);
|
|
||||||
serverLog(LL_WARNING,"SYNC failed. BGSAVE child returned an error");
|
serverLog(LL_WARNING,"SYNC failed. BGSAVE child returned an error");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1723,10 +1717,7 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type)
|
|||||||
if ((replica->repldbfd = open(g_pserver->rdb_filename,O_RDONLY)) == -1 ||
|
if ((replica->repldbfd = open(g_pserver->rdb_filename,O_RDONLY)) == -1 ||
|
||||||
redis_fstat(replica->repldbfd,&buf) == -1) {
|
redis_fstat(replica->repldbfd,&buf) == -1) {
|
||||||
ul.unlock();
|
ul.unlock();
|
||||||
if (FCorrectThread(replica))
|
freeClientAsync(replica);
|
||||||
freeClient(replica);
|
|
||||||
else
|
|
||||||
freeClientAsync(replica);
|
|
||||||
serverLog(LL_WARNING,"SYNC failed. Can't open/stat DB after BGSAVE: %s", strerror(errno));
|
serverLog(LL_WARNING,"SYNC failed. Can't open/stat DB after BGSAVE: %s", strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -3677,10 +3668,7 @@ void replicationDiscardCachedMaster(redisMaster *mi) {
|
|||||||
|
|
||||||
serverLog(LL_NOTICE,"Discarding previously cached master state.");
|
serverLog(LL_NOTICE,"Discarding previously cached master state.");
|
||||||
mi->cached_master->flags &= ~CLIENT_MASTER;
|
mi->cached_master->flags &= ~CLIENT_MASTER;
|
||||||
if (FCorrectThread(mi->cached_master))
|
freeClientAsync(mi->cached_master);
|
||||||
freeClient(mi->cached_master);
|
|
||||||
else
|
|
||||||
freeClientAsync(mi->cached_master);
|
|
||||||
mi->cached_master = NULL;
|
mi->cached_master = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user