From 45af2b174270af23a63b9032b2cbbb342d4e3a5f Mon Sep 17 00:00:00 2001 From: Jamie Scott <5336227+IAmATeaPot418@users.noreply.github.com> Date: Wed, 16 Oct 2019 13:31:19 -0700 Subject: [PATCH 1/3] Update to directive in redis.conf (missing s) The directive tls-prefer-server-cipher is actually tls-prefer-server-ciphers in config.c. This results in a failed directive call shown below. This pull request adds the "s" in ciphers so that the directive is able to be properly called in config.c ubuntu@ip-172-31-16-31:~/redis$ src/redis-server ./redis.conf *** FATAL CONFIG FILE ERROR *** Reading the configuration file, at line 200 >>> 'tls-prefer-server-cipher yes' Bad directive or wrong number of arguments --- redis.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.conf b/redis.conf index 408426f15..6e02cfed7 100644 --- a/redis.conf +++ b/redis.conf @@ -197,7 +197,7 @@ tcp-keepalive 300 # When choosing a cipher, use the server's preference instead of the client # preference. By default, the server follows the client's preference. # -# tls-prefer-server-cipher yes +# tls-prefer-server-ciphers yes ################################# GENERAL ##################################### From 2bc8db9ca5f80e7c69ca51932aed05745d727ec5 Mon Sep 17 00:00:00 2001 From: ShooterIT Date: Tue, 31 Dec 2019 21:35:56 +0800 Subject: [PATCH 2/3] Rename rdb asynchronously --- src/replication.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/replication.c b/src/replication.c index 68dc77a61..b7e77184a 100644 --- a/src/replication.c +++ b/src/replication.c @@ -31,6 +31,7 @@ #include "server.h" #include "cluster.h" +#include "bio.h" #include #include @@ -1616,14 +1617,20 @@ void readSyncBulkPayload(connection *conn) { killRDBChild(); } + /* Rename rdb like renaming rewrite aof asynchronously. */ + int old_rdb_fd = open(server.rdb_filename,O_RDONLY|O_NONBLOCK); if (rename(server.repl_transfer_tmpfile,server.rdb_filename) == -1) { serverLog(LL_WARNING, "Failed trying to rename the temp DB into %s in " "MASTER <-> REPLICA synchronization: %s", server.rdb_filename, strerror(errno)); cancelReplicationHandshake(); + if (old_rdb_fd != -1) close(old_rdb_fd); return; } + /* Close old rdb asynchronously. */ + if (old_rdb_fd != -1) bioCreateBackgroundJob(BIO_CLOSE_FILE,(void*)(long)old_rdb_fd,NULL,NULL); + if (rdbLoad(server.rdb_filename,&rsi,RDBFLAGS_REPLICATION) != C_OK) { serverLog(LL_WARNING, "Failed trying to load the MASTER synchronization " From 63e46e5f8db68f3b8b5e0ea6b3b852b1068c9894 Mon Sep 17 00:00:00 2001 From: Leo Murillo Date: Tue, 7 Jan 2020 13:55:26 -0600 Subject: [PATCH 3/3] Fix bug on KEYS command where pattern starts with * followed by \x00 (null char). --- src/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index 32bb35652..ba7be2725 100644 --- a/src/db.c +++ b/src/db.c @@ -602,7 +602,7 @@ void keysCommand(client *c) { void *replylen = addReplyDeferredLen(c); di = dictGetSafeIterator(c->db->dict); - allkeys = (pattern[0] == '*' && pattern[1] == '\0'); + allkeys = (pattern[0] == '*' && plen == 1); while((de = dictNext(di)) != NULL) { sds key = dictGetKey(de); robj *keyobj;