From 09c49392871776ff50ef04b791207effe4529245 Mon Sep 17 00:00:00 2001 From: VivekSainiEQ Date: Thu, 3 Jun 2021 21:47:33 +0000 Subject: [PATCH] Removed unused variables Former-commit-id: 48663bc480f7279a94c68aeebdd9721ca64f7038 --- src/config.cpp | 1 - src/evict.cpp | 1 - src/replication.cpp | 2 -- src/server.h | 6 +----- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index b546ef607..9d7f14007 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -2347,7 +2347,6 @@ static int updateReplBacklogSize(long long val, long long prev, const char **err UNUSED(err); g_pserver->repl_backlog_size = prev; resizeReplicationBacklog(val); - g_pserver->repl_backlog_config_size = g_pserver->repl_backlog_size; return 1; } diff --git a/src/evict.cpp b/src/evict.cpp index e7f0a10ef..7ec223f6d 100644 --- a/src/evict.cpp +++ b/src/evict.cpp @@ -399,7 +399,6 @@ size_t freeMemoryGetNotCountedMemory(void) { /* also don't count the replication backlog memory * that's where the replication clients get their memory from */ - // overhead += (g_pserver->repl_backlog_size - g_pserver->repl_backlog_config_size); overhead += g_pserver->repl_backlog_size; if (g_pserver->aof_state != AOF_OFF) { diff --git a/src/replication.cpp b/src/replication.cpp index a7a2aa79e..3a48963ab 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -1129,7 +1129,6 @@ void syncCommand(client *c) { if (!strcasecmp((const char*)ptrFromObj(c->argv[0]),"psync")) { if (masterTryPartialResynchronization(c) == C_OK) { g_pserver->stat_sync_partial_ok++; - // c->repl_curr_idx = g_pserver->repl_backlog_idx; return; /* No full resync needed, return. */ } else { char *master_replid = (char*)ptrFromObj(c->argv[1]); @@ -1157,7 +1156,6 @@ void syncCommand(client *c) { connDisableTcpNoDelay(c->conn); /* Non critical if it fails. */ c->repldbfd = -1; c->flags |= CLIENT_SLAVE; - // c->repl_curr_idx = g_pserver->repl_backlog_idx; listAddNodeTail(g_pserver->slaves,c); /* Create the replication backlog if needed. */ diff --git a/src/server.h b/src/server.h index 9fdf5e0ef..2aba985ed 100644 --- a/src/server.h +++ b/src/server.h @@ -1517,8 +1517,7 @@ struct client { copying this replica output buffer should use. */ - long long repl_curr_idx = -1; /* Replication index sent, if this is a replica */ - long long repl_curr_off = -1; + long long repl_curr_off = -1; /* Replication offset of the client, only if it's a replica*/ int fPendingReplicaWrite; char replid[CONFIG_RUN_ID_SIZE+1]; /* Master replication ID (if master). */ @@ -2416,9 +2415,6 @@ struct redisServer { uint16_t rglockSamples[s_lockContentionSamples]; unsigned ilockRingHead = 0; - long long repl_backlog_config_size = 1024*1024; /* This is a hack to ignore the resizing of the replication backlog - when using it as a defacto for the client buffer */ - bool FRdbSaveInProgress() const { return rdbThreadVars.fRdbThreadActive; } };