summaryrefslogtreecommitdiff
path: root/src/adlist.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-04-27 17:04:07 +0200
committerantirez <antirez@gmail.com>2017-04-27 17:08:37 +0200
commit469d6e2b37e2913ecb673f910cdb7dbd3af18a67 (patch)
tree5cc000471af07e4e41549fda93bdfad0d70afd25 /src/adlist.h
parentc861e1e1eee2c29c1df36759d471f6758048318f (diff)
downloadredis-469d6e2b37e2913ecb673f910cdb7dbd3af18a67.tar.gz
PSYNC2: fix master cleanup when caching it.
The master client cleanup was incomplete: resetClient() was missing and the output buffer of the client was not reset, so pending commands related to the previous connection could be still sent. The first problem caused the client argument vector to be, at times, half populated, so that when the correct replication stream arrived the protcol got mixed to the arugments creating invalid commands that nobody called. Thanks to @yangsiran for also investigating this problem, after already providing important design / implementation hints for the original PSYNC2 issues (see referenced Github issue). Note that this commit adds a new function to the list library of Redis in order to be able to reset a list without destroying it. Related to issue #3899.
Diffstat (limited to 'src/adlist.h')
-rw-r--r--src/adlist.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/adlist.h b/src/adlist.h
index be322552f..e457a979e 100644
--- a/src/adlist.h
+++ b/src/adlist.h
@@ -72,6 +72,7 @@ typedef struct list {
/* Prototypes */
list *listCreate(void);
void listRelease(list *list);
+void listEmpty(list *list);
list *listAddNodeHead(list *list, void *value);
list *listAddNodeTail(list *list, void *value);
list *listInsertNode(list *list, listNode *old_node, void *value, int after);