Unverified Commit e8eeba7b authored by Qu Chen's avatar Qu Chen Committed by GitHub
Browse files

Allow master to replicate command longer than replica's query buffer limit (#9340)

Replication client no longer checks incoming command length against the client-query-buffer-limit. This makes the master able to replicate commands longer than replica's configured client-query-buffer-limit 
parent 3307958b
......@@ -2196,7 +2196,7 @@ void readQueryFromClient(connection *conn) {
c->lastinteraction = server.unixtime;
if (c->flags & CLIENT_MASTER) c->read_reploff += nread;
atomicIncr(server.stat_net_input_bytes, nread);
if (sdslen(c->querybuf) > server.client_max_querybuf_len) {
if (!(c->flags & CLIENT_MASTER) && sdslen(c->querybuf) > server.client_max_querybuf_len) {
sds ci = catClientInfoString(sdsempty(),c), bytes = sdsempty();
bytes = sdscatrepr(bytes,c->querybuf,64);
......
......@@ -31,6 +31,19 @@ start_server {tags {"repl external:skip"}} {
assert_equal [r debug digest] [r -1 debug digest]
}
test {Master can replicate command longer than client-query-buffer-limit on replica} {
# Configure the master to have a bigger query buffer limit
r config set client-query-buffer-limit 2000000
r -1 config set client-query-buffer-limit 1048576
# Write a very large command onto the master
r set key [string repeat "x" 1100000]
wait_for_condition 300 100 {
[r -1 get key] eq [string repeat "x" 1100000]
} else {
fail "Unable to replicate command longer than client-query-buffer-limit"
}
}
test {Slave is able to evict keys created in writable slaves} {
r -1 select 5
assert {[r -1 dbsize] == 0}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment