Additional fixes

This commit is contained in:
John Sully 2022-08-23 17:33:14 +00:00
parent dd65d4af44
commit c97dc08e38

View File

@ -2977,6 +2977,7 @@ error:
}
void readSyncBulkPayload(connection *conn) {
serverAssert(GlobalLocksAcquired());
rdbSaveInfo rsi;
redisMaster *mi = (redisMaster*)connGetPrivateData(conn);
static int usemark = 0;
@ -2993,6 +2994,9 @@ void readSyncBulkPayload(connection *conn) {
return;
}
if (conn != mi->repl_transfer_s)
return;
/* Final setup of the connected slave <- master link */
replicationCreateMasterClient(mi,mi->repl_transfer_s,rsi.repl_stream_db);
if (mi->isRocksdbSnapshotRepl) {
@ -3801,12 +3805,14 @@ int connectWithMaster(redisMaster *mi) {
* Never call this function directly, use cancelReplicationHandshake() instead.
*/
void undoConnectWithMaster(redisMaster *mi) {
serverAssert(GlobalLocksAcquired());
auto conn = mi->repl_transfer_s;
connSetPrivateData(conn, nullptr);
aePostFunction(g_pserver->rgthreadvar[mi->ielReplTransfer].el, [conn]{
connClose(conn);
});
mi->repl_transfer_s = NULL;
int result = aePostFunction(g_pserver->rgthreadvar[mi->ielReplTransfer].el, [conn]{
connClose(conn);
}, false);
serverAssert(result == AE_OK);
}
/* Abort the async download of the bulk dataset while SYNC-ing with master.