Skip to content

Commit fde6110

Browse files
committed
remove repl-flow-control-enabled
Signed-off-by: xbasel <[email protected]>
1 parent c339066 commit fde6110

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

src/config.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,6 @@ standardConfig static_configs[] = {
31933193
createBoolConfig("cluster-slot-stats-enabled", NULL, MODIFIABLE_CONFIG, server.cluster_slot_stats_enabled, 0, NULL, NULL),
31943194
createBoolConfig("hide-user-data-from-log", NULL, MODIFIABLE_CONFIG, server.hide_user_data_from_log, 1, NULL, NULL),
31953195
createBoolConfig("import-mode", NULL, DEBUG_CONFIG | MODIFIABLE_CONFIG, server.import_mode, 0, NULL, NULL),
3196-
createBoolConfig("repl-flow-control-enabled", NULL, MODIFIABLE_CONFIG, server.repl_flow_control_enabled, 1, NULL, NULL),
31973196

31983197
/* String Configs */
31993198
createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, server.acl_filename, "", NULL, NULL),

src/networking.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3275,7 +3275,7 @@ void readToQueryBuf(client *c) {
32753275
*/
32763276
int shouldRepeatRead(client *c, int iteration) {
32773277
// If the client is not a primary replica, is closing, or flow control is disabled, no more reads.
3278-
if (!(c->flag.primary) || c->flag.close_asap || !server.repl_flow_control_enabled) {
3278+
if (!(c->flag.primary) || c->flag.close_asap || server.repl_max_reads_per_io_event == 1) {
32793279
return 0;
32803280
}
32813281

src/server.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <netinet/in.h>
5353
#include <sys/socket.h>
5454
#include <signal.h>
55+
#include <stdbool.h>
5556

5657
#ifdef HAVE_LIBSYSTEMD
5758
#include <systemd/sd-daemon.h>
@@ -135,7 +136,8 @@ struct hdr_histogram;
135136
#define CONFIG_BGSAVE_RETRY_DELAY 5 /* Wait a few secs before trying again. */
136137
#define CONFIG_DEFAULT_PID_FILE "/var/run/valkey.pid"
137138
#define CONFIG_DEFAULT_BINDADDR_COUNT 2
138-
#define CONFIG_DEFAULT_BINDADDR {"*", "-::*"}
139+
#define CONFIG_DEFAULT_BINDADDR \
140+
{ "*", "-::*" }
139141
#define NET_HOST_STR_LEN 256 /* Longest valid hostname */
140142
#define NET_IP_STR_LEN 46 /* INET6_ADDRSTRLEN is 46, but we need to be sure */
141143
#define NET_ADDR_STR_LEN (NET_IP_STR_LEN + 32) /* Must be enough for ip:port */
@@ -1444,7 +1446,8 @@ typedef struct rdbSaveInfo {
14441446
long long repl_offset; /* Replication offset. */
14451447
} rdbSaveInfo;
14461448

1447-
#define RDB_SAVE_INFO_INIT {-1, 0, "0000000000000000000000000000000000000000", -1}
1449+
#define RDB_SAVE_INFO_INIT \
1450+
{ -1, 0, "0000000000000000000000000000000000000000", -1 }
14481451

14491452
struct malloc_stats {
14501453
size_t zmalloc_used;
@@ -2148,7 +2151,6 @@ struct valkeyServer {
21482151
char *debug_context; /* A free-form string that has no impact on server except being included in a crash report. */
21492152

21502153
/* Replication flow control */
2151-
int repl_flow_control_enabled; /* Enables adaptive flow control for replication reads on the replica */
21522154
int repl_max_reads_per_io_event; /* Maximum allowed reads from the primary file descriptor per I/O event */
21532155
};
21542156

valkey.conf

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,19 +2538,9 @@ jemalloc-bg-thread yes
25382538

25392539
################################## REPLICATION FLOW CONTROL ##################################
25402540

2541-
# Prioritizes replication traffic to reduce primary buffer overflows,
2542-
# reducing lag and the risk of full syncs. Allows the replica to
2543-
# consume data faster under high load.
2544-
#
2545-
# If enabled, the replica invokes multiple reads per I/O event when it
2546-
# detects replication pressure.
2547-
#
2548-
# Default: yes
2549-
# repl-flow-control-enabled yes
2550-
2551-
# Specifies the maximum number of replication reads allowed per I/O event.
2552-
# Higher values allow more replication data to be processed per event, reducing replication lag,
2553-
# but can throttle normal clients and increase their latency.
2541+
# Controls how aggressively the replica prioritizes replication reads over normal clients.
2542+
# Higher values allow more replication data to be processed per I/O event, reducing lag and risk of full syncs.
2543+
# A value of 1 effectively disables the feature.
25542544
#
25552545
# Default: 25
25562546
# repl-max-reads-per-io-event 25

0 commit comments

Comments
 (0)