Skip to content

Commit 088c26a

Browse files
committed
extern: merged patches from the upstream redis/3.2.9+ @d067e334
1 parent c84ea12 commit 088c26a

33 files changed

+698
-35
lines changed

extern/redis-3.2.8/00-RELEASENOTES

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,52 @@ HIGH: There is a critical bug that may affect a subset of users. Upgrade!
1010
CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP.
1111
--------------------------------------------------------------------------------
1212

13+
================================================================================
14+
Redis 3.2.9 Released Mon May 17 17:35:38 CEST 2017
15+
================================================================================
16+
17+
Upgrade urgency LOW: A few rarely harmful bugs were fixed.
18+
19+
This release just fixes bugs that are unlikely to cause serious problems
20+
so there is no need to update ASAP. Please, see the list of commits
21+
for the details on the bugs fixed and credits:
22+
23+
antirez in commit 3b46cf97:
24+
redis-cli --bigkeys: show error when TYPE fails.
25+
1 file changed, 7 insertions(+), 2 deletions(-)
26+
27+
antirez in commit f59b4b93:
28+
Fix preprocessor if/else chain broken in order to fix #3927.
29+
1 file changed, 3 insertions(+)
30+
31+
antirez in commit dd80fedf:
32+
Fix zmalloc_get_memory_size() ifdefs to actually use the else branch.
33+
1 file changed, 2 deletions(-)
34+
35+
antirez in commit 697d3abe:
36+
Set lua-time-limit default value at safe place.
37+
2 files changed, 1 insertion(+), 1 deletion(-)
38+
39+
antirez in commit c9c04b11:
40+
Fix #3848 by closing the descriptor on error.
41+
1 file changed, 2 insertions(+), 1 deletion(-)
42+
43+
张文康 in commit d3b49924:
44+
update block->free after some diff data are written to the child process
45+
1 file changed, 1 insertion(+)
46+
47+
antirez in commit 6a33952b:
48+
Test: fix, hopefully, false PSYNC failure like in issue #2715.
49+
1 file changed, 1 insertion(+), 1 deletion(-)
50+
51+
John.Koepi in commit b83f9fea:
52+
fix #2883, #2857 pipe fds leak when fork() failed on bg aof rw
53+
1 file changed, 1 insertion(+)
54+
55+
antirez in commit 10dbb5cd:
56+
Don't leak file descriptor on syncWithMaster().
57+
1 file changed, 2 insertions(+), 1 deletion(-)
58+
1359
================================================================================
1460
Redis 3.2.8 Released Sun Feb 12 16:11:18 CET 2017
1561
================================================================================

extern/redis-3.2.8/patch/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
all:
22

3-
patch reverse:
3+
patch revert:
44
@bash run.sh $@

extern/redis-3.2.8/patch/redis/0001-Don-t-leak-file-descriptor-on-syncWithMaster.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 10dbb5cd33cdc78edc70c1827e5c7c7f46eb9538 Mon Sep 17 00:00:00 2001
22
From: antirez <[email protected]>
33
Date: Mon, 20 Feb 2017 10:18:41 +0100
4-
Subject: [PATCH 1/8] Don't leak file descriptor on syncWithMaster().
4+
Subject: [PATCH 01/19] Don't leak file descriptor on syncWithMaster().
55

66
Close #3804.
77
---
@@ -30,5 +30,5 @@ index e7194e59..8d9bcfbf 100644
3030
server.repl_transfer_s = -1;
3131
server.repl_state = REPL_STATE_CONNECT;
3232
--
33-
2.12.2
33+
2.13.1
3434

extern/redis-3.2.8/patch/redis/0002-fix-2883-2857-pipe-fds-leak-when-fork-failed-on-bg-a.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From b83f9fea81411c4809218bd7c51f974e4c4ad7a8 Mon Sep 17 00:00:00 2001
22
From: "John.Koepi" <[email protected]>
33
Date: Sat, 23 Jul 2016 16:31:56 +0200
4-
Subject: [PATCH 2/8] fix #2883, #2857 pipe fds leak when fork() failed on bg
4+
Subject: [PATCH 02/19] fix #2883, #2857 pipe fds leak when fork() failed on bg
55
aof rw
66

77
---
@@ -21,5 +21,5 @@ index c6fbbb82..862b5e13 100644
2121
}
2222
serverLog(LL_NOTICE,
2323
--
24-
2.12.2
24+
2.13.1
2525

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
From bacb04f89fe22b98881f86523ce8f7b8b6542084 Mon Sep 17 00:00:00 2001
2+
From: Qu Chen <[email protected]>
3+
Date: Fri, 7 Apr 2017 22:31:11 +0000
4+
Subject: [PATCH 03/19] Implement getKeys procedure for georadius and
5+
georadiusbymember commands.
6+
7+
---
8+
src/db.c | 38 ++++++++++++++++++++++++++++++++++++++
9+
src/server.c | 4 ++--
10+
src/server.h | 1 +
11+
3 files changed, 41 insertions(+), 2 deletions(-)
12+
13+
diff --git a/src/db.c b/src/db.c
14+
index fba731c9..75905e2d 100644
15+
--- a/src/db.c
16+
+++ b/src/db.c
17+
@@ -1234,6 +1234,44 @@ int *migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkey
18+
return keys;
19+
}
20+
21+
+/* Helper function to extract keys from following commands:
22+
+ * GEORADIUS key x y radius unit [WITHDIST] [WITHHASH] [WITHCOORD] [ASC|DESC]
23+
+ * [COUNT count] [STORE key] [STOREDIST key]
24+
+ * GEORADIUSBYMEMBER key member radius unit ... options ... */
25+
+int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
26+
+ int i, num, *keys;
27+
+ UNUSED(cmd);
28+
+
29+
+ /* Check for the presence of the stored key in the command */
30+
+ int stored_key = -1;
31+
+ for (i = 5; i < argc; i++) {
32+
+ char *arg = argv[i]->ptr;
33+
+ /* For the case when user specifies both "store" and "storedist" options, the
34+
+ * second key specified would override the first key. This behavior is kept
35+
+ * the same as in georadiusCommand method.
36+
+ */
37+
+ if ((!strcasecmp(arg, "store") || !strcasecmp(arg, "storedist")) && ((i+1) < argc)) {
38+
+ stored_key = i+1;
39+
+ i++;
40+
+ }
41+
+ }
42+
+ num = 1 + (stored_key == -1 ? 0 : 1);
43+
+
44+
+ /* Keys in the command come from two places:
45+
+ * argv[1] = key,
46+
+ * argv[5...n] = stored key if present
47+
+ */
48+
+ keys = zmalloc(sizeof(int) * num);
49+
+
50+
+ /* Add all key positions to keys[] */
51+
+ keys[0] = 1;
52+
+ if(num > 1) {
53+
+ keys[1] = stored_key;
54+
+ }
55+
+ *numkeys = num;
56+
+ return keys;
57+
+}
58+
+
59+
/* Slot to Key API. This is used by Redis Cluster in order to obtain in
60+
* a fast way a key that belongs to a specified hash slot. This is useful
61+
* while rehashing the cluster. */
62+
diff --git a/src/server.c b/src/server.c
63+
index 71bcda7d..cc23c817 100644
64+
--- a/src/server.c
65+
+++ b/src/server.c
66+
@@ -284,8 +284,8 @@ struct redisCommand redisCommandTable[] = {
67+
{"wait",waitCommand,3,"s",0,NULL,0,0,0,0,0},
68+
{"command",commandCommand,0,"lt",0,NULL,0,0,0,0,0},
69+
{"geoadd",geoaddCommand,-5,"wm",0,NULL,1,1,1,0,0},
70+
- {"georadius",georadiusCommand,-6,"w",0,NULL,1,1,1,0,0},
71+
- {"georadiusbymember",georadiusByMemberCommand,-5,"w",0,NULL,1,1,1,0,0},
72+
+ {"georadius",georadiusCommand,-6,"w",0,georadiusGetKeys,1,1,1,0,0},
73+
+ {"georadiusbymember",georadiusByMemberCommand,-5,"w",0,georadiusGetKeys,1,1,1,0,0},
74+
{"geohash",geohashCommand,-2,"r",0,NULL,1,1,1,0,0},
75+
{"geopos",geoposCommand,-2,"r",0,NULL,1,1,1,0,0},
76+
{"geodist",geodistCommand,-4,"r",0,NULL,1,1,1,0,0},
77+
diff --git a/src/server.h b/src/server.h
78+
index 3fa7c3ac..4ca73a25 100644
79+
--- a/src/server.h
80+
+++ b/src/server.h
81+
@@ -1435,6 +1435,7 @@ int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *num
82+
int *evalGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys);
83+
int *sortGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys);
84+
int *migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys);
85+
+int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys);
86+
87+
/* Cluster */
88+
void clusterInit(void);
89+
--
90+
2.13.1
91+

extern/redis-3.2.8/patch/redis/0003-Test-fix-hopefully-false-PSYNC-failure-like-in-issue.patch renamed to extern/redis-3.2.8/patch/redis/0004-Test-fix-hopefully-false-PSYNC-failure-like-in-issue.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 6a33952b8af18c4c0e778d93a69d97bc2adbc52e Mon Sep 17 00:00:00 2001
22
From: antirez <[email protected]>
33
Date: Fri, 14 Apr 2017 17:53:11 +0200
4-
Subject: [PATCH 3/8] Test: fix, hopefully, false PSYNC failure like in issue
4+
Subject: [PATCH 04/19] Test: fix, hopefully, false PSYNC failure like in issue
55
#2715.
66

77
And many other related Github issues... all reporting the same problem.
@@ -26,5 +26,5 @@ index 3a41ceb2..308d63d0 100644
2626
} $diskless 1
2727

2828
--
29-
2.12.2
29+
2.13.1
3030

extern/redis-3.2.8/patch/redis/0004-update-block-free-after-some-diff-data-are-written-t.patch renamed to extern/redis-3.2.8/patch/redis/0005-update-block-free-after-some-diff-data-are-written-t.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ From d3b499245015b198fb3bd2814453b5852cad3d3f Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?=E5=BC=A0=E6=96=87=E5=BA=B7?=
33
44
Date: Tue, 18 Apr 2017 20:10:08 +0800
5-
Subject: [PATCH 4/8] update block->free after some diff data are written to
5+
Subject: [PATCH 05/19] update block->free after some diff data are written to
66
the child process
77

88
---
@@ -22,5 +22,5 @@ index 862b5e13..cbd906c9 100644
2222
if (block->used == 0) listDelNode(server.aof_rewrite_buf_blocks,ln);
2323
}
2424
--
25-
2.12.2
25+
2.13.1
2626

extern/redis-3.2.8/patch/redis/0005-Fix-3848-by-closing-the-descriptor-on-error.patch renamed to extern/redis-3.2.8/patch/redis/0006-Fix-3848-by-closing-the-descriptor-on-error.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From c9c04b11b971bb0598307cf2aafe8954e7785641 Mon Sep 17 00:00:00 2001
22
From: antirez <[email protected]>
33
Date: Tue, 18 Apr 2017 16:24:06 +0200
4-
Subject: [PATCH 5/8] Fix #3848 by closing the descriptor on error.
4+
Subject: [PATCH 06/19] Fix #3848 by closing the descriptor on error.
55

66
---
77
src/anet.c | 3 ++-
@@ -29,5 +29,5 @@ index ef1711d0..e16ce131 100644
2929
end:
3030
freeaddrinfo(servinfo);
3131
--
32-
2.12.2
32+
2.13.1
3333

extern/redis-3.2.8/patch/redis/0006-Set-lua-time-limit-default-value-at-safe-place.patch renamed to extern/redis-3.2.8/patch/redis/0007-Set-lua-time-limit-default-value-at-safe-place.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 697d3abeff1563936da2653a8fa8db78d5dff671 Mon Sep 17 00:00:00 2001
22
From: antirez <[email protected]>
33
Date: Tue, 11 Apr 2017 16:56:00 +0200
4-
Subject: [PATCH 6/8] Set lua-time-limit default value at safe place.
4+
Subject: [PATCH 07/19] Set lua-time-limit default value at safe place.
55

66
Otherwise, as it was, it will overwrite whatever the user set.
77

@@ -36,5 +36,5 @@ index 71bcda7d..609f3966 100644
3636
server.lruclock = getLRUClock();
3737
resetServerSaveParams();
3838
--
39-
2.12.2
39+
2.13.1
4040

extern/redis-3.2.8/patch/redis/0007-Fix-zmalloc_get_memory_size-ifdefs-to-actually-use-t.patch renamed to extern/redis-3.2.8/patch/redis/0008-Fix-zmalloc_get_memory_size-ifdefs-to-actually-use-t.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
From dd80fedf6fd10556cac7d8318fa4b34fa67a1c81 Mon Sep 17 00:00:00 2001
22
From: antirez <[email protected]>
33
Date: Tue, 11 Apr 2017 16:45:08 +0200
4-
Subject: [PATCH 7/8] Fix zmalloc_get_memory_size() ifdefs to actually use the
5-
else branch.
4+
Subject: [PATCH 08/19] Fix zmalloc_get_memory_size() ifdefs to actually use
5+
the else branch.
66

77
Close #3927.
88
---
@@ -23,5 +23,5 @@ index 640ee19e..d795f448 100644
2323
return 0L; /* Unknown OS. */
2424
#endif
2525
--
26-
2.12.2
26+
2.13.1
2727

0 commit comments

Comments
 (0)