Dual Channel Replication - Verify Replica Local Buffer Limit Configuration (#989)
Prior to comparing the replica buffer against the configured limit, we need to ensure that the limit configuration is enabled. If the limit is set to zero, it indicates that there is no limit, and we should skip the buffer limit check. --------- Signed-off-by: naglera <anagler123@gmail.com> Signed-off-by: Ping Xie <pingxie@google.com>
This commit is contained in:
parent
e495448dbe
commit
bc6cca24c3
@ -2805,7 +2805,8 @@ void bufferReplData(connection *conn) {
|
||||
remaining_bytes = readIntoReplDataBlock(conn, tail, remaining_bytes);
|
||||
}
|
||||
if (readlen && remaining_bytes == 0) {
|
||||
if (server.pending_repl_data.len > server.client_obuf_limits[CLIENT_TYPE_REPLICA].hard_limit_bytes) {
|
||||
if (server.client_obuf_limits[CLIENT_TYPE_REPLICA].hard_limit_bytes &&
|
||||
server.pending_repl_data.len > server.client_obuf_limits[CLIENT_TYPE_REPLICA].hard_limit_bytes) {
|
||||
serverLog(LL_NOTICE, "Replication buffer limit reached, stopping buffering.");
|
||||
/* Stop accumulating primary commands. */
|
||||
connSetReadHandler(conn, NULL);
|
||||
|
@ -132,8 +132,9 @@ start_server {} {
|
||||
# with master.
|
||||
$master config set repl-timeout 1000
|
||||
$replica1 config set repl-timeout 1000
|
||||
$replica1 config set client-output-buffer-limit "replica 1024 0 0"
|
||||
$replica2 config set repl-timeout 1000
|
||||
$replica2 config set client-output-buffer-limit "replica 0 0 0"
|
||||
$replica2 config set client-output-buffer-limit "replica 1024 0 0"
|
||||
$replica2 config set dual-channel-replication-enabled $dualchannel
|
||||
|
||||
$replica1 replicaof $master_host $master_port
|
||||
|
Loading…
x
Reference in New Issue
Block a user