reduce repeated calls to use_diskless_load
this function possibly iterates on the module list Former-commit-id: 99762dac23e26a217fcd66531ee4ca9b4d13a7ac
This commit is contained in:
parent
f084ee6f17
commit
10a7bfe3a2
@ -1719,7 +1719,7 @@ void disklessLoadRestoreBackups(redisDb *backup, int restore, int empty_db_flags
|
|||||||
void readSyncBulkPayload(connection *conn) {
|
void readSyncBulkPayload(connection *conn) {
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
ssize_t nread, readlen, nwritten;
|
ssize_t nread, readlen, nwritten;
|
||||||
int use_diskless_load;
|
int use_diskless_load = useDisklessLoad();
|
||||||
redisDb *diskless_load_backup = NULL;
|
redisDb *diskless_load_backup = NULL;
|
||||||
rdbSaveInfo rsi = RDB_SAVE_INFO_INIT;
|
rdbSaveInfo rsi = RDB_SAVE_INFO_INIT;
|
||||||
int empty_db_flags = g_pserver->repl_slave_lazy_flush ? EMPTYDB_ASYNC :
|
int empty_db_flags = g_pserver->repl_slave_lazy_flush ? EMPTYDB_ASYNC :
|
||||||
@ -1782,19 +1782,18 @@ void readSyncBulkPayload(connection *conn) {
|
|||||||
mi->repl_transfer_size = 0;
|
mi->repl_transfer_size = 0;
|
||||||
serverLog(LL_NOTICE,
|
serverLog(LL_NOTICE,
|
||||||
"MASTER <-> REPLICA sync: receiving streamed RDB from master with EOF %s",
|
"MASTER <-> REPLICA sync: receiving streamed RDB from master with EOF %s",
|
||||||
useDisklessLoad()? "to parser":"to disk");
|
use_diskless_load? "to parser":"to disk");
|
||||||
} else {
|
} else {
|
||||||
usemark = 0;
|
usemark = 0;
|
||||||
mi->repl_transfer_size = strtol(buf+1,NULL,10);
|
mi->repl_transfer_size = strtol(buf+1,NULL,10);
|
||||||
serverLog(LL_NOTICE,
|
serverLog(LL_NOTICE,
|
||||||
"MASTER <-> REPLICA sync: receiving %lld bytes from master %s",
|
"MASTER <-> REPLICA sync: receiving %lld bytes from master %s",
|
||||||
(long long) mi->repl_transfer_size,
|
(long long) mi->repl_transfer_size,
|
||||||
useDisklessLoad() ? "to parser" : "to disk");
|
use_diskless_load? "to parser":"to disk");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_diskless_load = useDisklessLoad();
|
|
||||||
if (!use_diskless_load) {
|
if (!use_diskless_load) {
|
||||||
/* Read the data from the socket, store it to a file and search
|
/* Read the data from the socket, store it to a file and search
|
||||||
* for the EOF. */
|
* for the EOF. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user