From 5f8360eb21e798f468162bed76c839a8ed28f480 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 16 Oct 2014 10:00:46 +0200 Subject: [PATCH] Diskless replication flag renamed repl_diskless -> repl_diskless_sync. --- src/redis.c | 2 +- src/redis.h | 6 +++--- src/replication.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/redis.c b/src/redis.c index d8ba5675a..7aa12fc60 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1480,7 +1480,7 @@ void initServerConfig(void) { server.repl_slave_ro = REDIS_DEFAULT_SLAVE_READ_ONLY; server.repl_down_since = 0; /* Never connected, repl is down since EVER. */ server.repl_disable_tcp_nodelay = REDIS_DEFAULT_REPL_DISABLE_TCP_NODELAY; - server.repl_diskless = REDIS_DEFAULT_RDB_DISKLESS; + server.repl_diskless_sync = REDIS_DEFAULT_RDB_DISKLESS_SYNC; server.slave_priority = REDIS_DEFAULT_SLAVE_PRIORITY; server.master_repl_offset = 0; diff --git a/src/redis.h b/src/redis.h index fd491b453..b5fdf9be1 100644 --- a/src/redis.h +++ b/src/redis.h @@ -114,8 +114,8 @@ typedef long long mstime_t; /* millisecond time type. */ #define REDIS_DEFAULT_RDB_COMPRESSION 1 #define REDIS_DEFAULT_RDB_CHECKSUM 1 #define REDIS_DEFAULT_RDB_FILENAME "dump.rdb" -#define REDIS_DEFAULT_RDB_DISKLESS 0 -#define REDIS_DEFAULT_RDB_DISKLESS_DELAY 5 +#define REDIS_DEFAULT_RDB_DISKLESS_SYNC 0 +#define REDIS_DEFAULT_RDB_DISKLESS_SYNC_DELAY 5 #define REDIS_DEFAULT_SLAVE_SERVE_STALE_DATA 1 #define REDIS_DEFAULT_SLAVE_READ_ONLY 1 #define REDIS_DEFAULT_REPL_DISABLE_TCP_NODELAY 0 @@ -801,7 +801,7 @@ struct redisServer { int repl_min_slaves_to_write; /* Min number of slaves to write. */ int repl_min_slaves_max_lag; /* Max lag of slaves to write. */ int repl_good_slaves_count; /* Number of slaves with lag <= max_lag. */ - int repl_diskless; /* Send RDB to slaves sockets directly. */ + int repl_diskless_sync; /* Send RDB to slaves sockets directly. */ /* Replication (slave) */ char *masterauth; /* AUTH with this password with master */ char *masterhost; /* Hostname of master */ diff --git a/src/replication.c b/src/replication.c index 11ed3a912..004b7784c 100644 --- a/src/replication.c +++ b/src/replication.c @@ -417,9 +417,9 @@ int startBgsaveForReplication(void) { int retval; redisLog(REDIS_NOTICE,"Starting BGSAVE for SYNC with target: %s", - server.repl_diskless ? "slaves sockets" : "disk"); + server.repl_diskless_sync ? "slaves sockets" : "disk"); - if (server.repl_diskless) + if (server.repl_diskless_sync) retval = rdbSaveToSlavesSockets(); else retval = rdbSaveBackground(server.rdb_filename); @@ -523,7 +523,7 @@ void syncCommand(redisClient *c) { c->replstate = REDIS_REPL_WAIT_BGSAVE_START; redisLog(REDIS_NOTICE,"Waiting for next BGSAVE for SYNC"); } else { - if (server.repl_diskless) { + if (server.repl_diskless_sync) { /* Diskless replication RDB child is created inside * replicationCron() since we want to delay its start a * few seconds to wait for more slaves to arrive. */ @@ -1944,7 +1944,7 @@ void replicationCron(void) { /* If we are using diskless replication and there are slaves waiting * in WAIT_BGSAVE_START state, check if enough seconds elapsed and * start one. */ - if (server.repl_diskless && server.rdb_child_pid == -1 && + if (server.repl_diskless_sync && server.rdb_child_pid == -1 && server.aof_child_pid == -1) { time_t idle, max_idle = 0; @@ -1962,7 +1962,7 @@ void replicationCron(void) { } } - if (slaves_waiting && max_idle > REDIS_DEFAULT_RDB_DISKLESS_DELAY) { + if (slaves_waiting && max_idle > REDIS_DEFAULT_RDB_DISKLESS_SYNC_DELAY) { /* Let's start a BGSAVE with disk target. */ if (startBgsaveForReplication() == REDIS_OK) { /* It started! We need to change the state of slaves