Skip to content

Commit ad785bc

Browse files
enjoy-binbinzhijun42
authored andcommitted
Update dual channel replication conf to mention the local buffer is imited by COB (valkey-io#2824)
After introducing the dual channel replication in valkey-io#60, we decided in valkey-io#915 not to add a new configuration item to limit the replica's local replication buffer, just use "client-output-buffer-limit replica hard" to limit it. We need to document this behavior and mention that once the limit is reached, all future data will accumulate in the primary side. Signed-off-by: Binbin <[email protected]>
1 parent d10bebc commit ad785bc

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/replication.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3211,7 +3211,10 @@ void bufferReplData(connection *conn) {
32113211
if (readlen && remaining_bytes == 0) {
32123212
if (server.client_obuf_limits[CLIENT_TYPE_REPLICA].hard_limit_bytes &&
32133213
server.pending_repl_data.len > server.client_obuf_limits[CLIENT_TYPE_REPLICA].hard_limit_bytes) {
3214-
dualChannelServerLog(LL_NOTICE, "Replication buffer limit reached, stopping buffering.");
3214+
dualChannelServerLog(LL_NOTICE,
3215+
"Replication buffer limit reached (%llu bytes), stopping buffering. "
3216+
"Further accumulation will occur on primary side.",
3217+
server.client_obuf_limits[CLIENT_TYPE_REPLICA].hard_limit_bytes);
32153218
/* Stop accumulating primary commands. */
32163219
connSetReadHandler(conn, NULL);
32173220
break;

tests/integration/dual-channel-replication.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ start_server {tags {"dual-channel-replication external:skip"}} {
431431
populate 10000 primary 10; # set ~ 100kb
432432
# Wait for replica's buffer limit reached
433433
wait_for_condition 50 1000 {
434-
[log_file_matches $replica1_log "*Replication buffer limit reached, stopping buffering*"]
434+
[log_file_matches $replica1_log "*Replication buffer limit reached (*), stopping buffering*"]
435435
} else {
436436
fail "Replica buffer should fill"
437437
}

valkey.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,12 @@ repl-diskless-load disabled
818818
# generally beneficial as it prevents potential performance degradation on the primary
819819
# server, which is typically handling more critical operations.
820820
#
821+
# During the dual channel full sync, the maximum size of the local replication buffer
822+
# on the replica is limited by the hard limit of the replica client output buffer on
823+
# the replica side. When the replica reaches the limit, it will stop accumulating the
824+
# further data. At this point, any additional data accumulation will occur on primary
825+
# side, which is depending on the replica client output buffer on the primary side.
826+
#
821827
# When toggling this configuration on or off during an ongoing synchronization process,
822828
# it does not change the already running sync method. The new configuration will take
823829
# effect only for subsequent synchronization processes.

0 commit comments

Comments
 (0)