summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-13 22:12:29 +0800
committerGitHub <noreply@github.com>2023-03-13 16:12:29 +0200
commit7997874f4d2be9da1e26c77804569b0057c1e0a2 (patch)
tree05e013c1930e6b76caee3ca6dcfa991a6ad7630c /src/server.h
parent7be7834e6573134b1e5a0b8ea90acf856b0c7774 (diff)
downloadredis-7997874f4d2be9da1e26c77804569b0057c1e0a2.tar.gz
Fix tail->repl_offset update in feedReplicationBuffer (#11905)
In #11666, we added a while loop and will split a big reply node to multiple nodes. The update of tail->repl_offset may be wrong. Like before #11666, we would have created at most one new reply node, and now we will create multiple nodes if it is a big reply node. Now we are creating more than one node, and the tail->repl_offset of all the nodes except the last one are incorrect. Because we update master_repl_offset at the beginning, and then use it to update the tail->repl_offset. This would have lead to an assertion during PSYNC, a test was added to validate that case. Besides that, the calculation of size was adjusted to fix tests that failed due to a combination of a very low backlog size, and some thresholds of that get violated because of the relatively high overhead of replBufBlock. So now if the backlog size / 16 is too small, we'll take PROTO_REPLY_CHUNK_BYTES instead. Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server.h b/src/server.h
index 04371e959..a3d9aa088 100644
--- a/src/server.h
+++ b/src/server.h
@@ -921,7 +921,7 @@ typedef struct clientReplyBlock {
* | / \
* | / \
* | / \
- * Repl Backlog Replia_A Replia_B
+ * Repl Backlog Replica_A Replica_B
*
* Each replica or replication backlog increments only the refcount of the
* 'ref_repl_buf_node' which it points to. So when replica walks to the next