Skip to content

Commit

Permalink
rename primary_can_sync_using_rdb_channel-> master_supports_rdb_channel
Browse files Browse the repository at this point in the history
  • Loading branch information
naglera committed Jan 4, 2024
1 parent 21c797e commit b7c1688
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ static int useDisklessLoad(void) {
}

static int useRdbChannelSync(void) {
return server.rdb_channel_enabled && (server.primary_can_sync_using_rdb_channel == 1);
return server.rdb_channel_enabled && (server.master_supports_rdb_channel == 1);
}

/* Helper function for readSyncBulkPayload() to initialize tempDb
Expand Down Expand Up @@ -2527,7 +2527,7 @@ void abortRdbConnectionSync(int should_retry) {

if (!should_retry) {
/* Make sure next time we will try different approach */
server.primary_can_sync_using_rdb_channel = 0;
server.master_supports_rdb_channel = 0;
}
return;
}
Expand Down Expand Up @@ -3590,7 +3590,7 @@ void replicationSetMaster(char *ip, int port) {
NULL);

server.repl_state = REPL_STATE_CONNECT;
server.primary_can_sync_using_rdb_channel = 1;
server.master_supports_rdb_channel = 1;
serverLog(LL_NOTICE,"Connecting to MASTER %s:%d",
server.masterhost, server.masterport);
connectWithMaster();
Expand Down
2 changes: 1 addition & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2677,7 +2677,7 @@ void initServer(void) {
server.cron_malloc_stats.allocator_active = 0;
server.cron_malloc_stats.allocator_resident = 0;
server.lastbgsave_status = C_OK;
server.primary_can_sync_using_rdb_channel = 1;
server.master_supports_rdb_channel = 1;
server.aof_last_write_status = C_OK;
server.aof_last_write_errno = 0;
server.repl_good_slaves_count = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ struct redisServer {
int rdb_bgsave_scheduled; /* BGSAVE when possible if true. */
int rdb_child_type; /* Type of save by active child. */
int lastbgsave_status; /* C_OK or C_ERR */
int primary_can_sync_using_rdb_channel; /* Track whether the primary is able to sync using rdb channel */
int master_supports_rdb_channel;/* Track whether the master is able to sync using rdb channel */
int stop_writes_on_bgsave_err; /* Don't allow writes if can't BGSAVE */
int rdb_pipe_read; /* RDB pipe used to transfer the rdb data */
/* to the parent process in diskless repl. */
Expand Down

0 comments on commit b7c1688

Please sign in to comment.