Raltively simple update to Redis 6.0.9.

Upgrade urgency is MODERATE due to a local patch for zmalloc. Thanks to
the upstream fix, we can now remove it. We need a new trivial time_t
patch.

Full changelog:

https://github.com/redis/redis/blob/6.0.9/00-RELEASENOTES

Tested on amd64, macppc and sparc64

Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/redis/Makefile,v
retrieving revision 1.116
diff -u -p -r1.116 Makefile
--- Makefile    11 Sep 2020 13:54:01 -0000      1.116
+++ Makefile    27 Oct 2020 12:59:32 -0000
@@ -1,7 +1,7 @@
 # $OpenBSD: Makefile,v 1.116 2020/09/11 13:54:01 tb Exp $
 
 COMMENT =              persistent key-value database
-DISTNAME =             redis-6.0.8
+DISTNAME =             redis-6.0.9
 CATEGORIES =           databases
 HOMEPAGE =             https://redis.io/
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/databases/redis/distinfo,v
retrieving revision 1.90
diff -u -p -r1.90 distinfo
--- distinfo    11 Sep 2020 13:54:01 -0000      1.90
+++ distinfo    27 Oct 2020 12:59:32 -0000
@@ -1,2 +1,2 @@
-SHA256 (redis-6.0.8.tar.gz) = BPof3cOb0a7LZzndXdc4WKNRW0J6zR4pR6Ztrc6GjWg=
-SIZE (redis-6.0.8.tar.gz) = 2247528
+SHA256 (redis-6.0.9.tar.gz) = 3Cvc+BxiDp8Jz9EuhdO8YxyJey23pVIY/Ypl6qN/ht0=
+SIZE (redis-6.0.9.tar.gz) = 2261418
Index: patches/patch-redis_conf
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-redis_conf,v
retrieving revision 1.23
diff -u -p -r1.23 patch-redis_conf
--- patches/patch-redis_conf    3 Sep 2020 04:29:27 -0000       1.23
+++ patches/patch-redis_conf    27 Oct 2020 12:59:32 -0000
@@ -13,7 +13,7 @@ Main changes in this file:
 Index: redis.conf
 --- redis.conf.orig
 +++ redis.conf
-@@ -106,8 +106,8 @@ tcp-backlog 511
+@@ -105,8 +105,8 @@ tcp-backlog 511
  # incoming connections. There is no default, so Redis will not listen
  # on a unix socket when not specified.
  #
@@ -24,7 +24,7 @@ Index: redis.conf
  
  # Close the connection after a client is idle for N seconds (0 to disable)
  timeout 0
-@@ -154,6 +154,7 @@ tcp-keepalive 300
+@@ -153,6 +153,7 @@ tcp-keepalive 300
  # of these, and will not implicitly use the system wide configuration.
  #
  # tls-ca-cert-file ca.crt
@@ -32,7 +32,7 @@ Index: redis.conf
  # tls-ca-cert-dir /etc/ssl/certs
  
  # By default, clients (including replica servers) on a TLS port are required
-@@ -184,14 +185,14 @@ tcp-keepalive 300
+@@ -183,14 +184,14 @@ tcp-keepalive 300
  #
  # tls-protocols "TLSv1.2 TLSv1.3"
  
@@ -49,7 +49,7 @@ Index: redis.conf
  # information about the syntax of this string, and specifically for TLSv1.3
  # ciphersuites.
  #
-@@ -221,8 +222,9 @@ tcp-keepalive 300
+@@ -220,8 +221,9 @@ tcp-keepalive 300
  ################################# GENERAL 
#####################################
  
  # By default Redis does not run as a daemon. Use 'yes' if you need it.
@@ -108,7 +108,7 @@ Index: redis.conf
  
  ################################# REPLICATION 
#################################
  
-@@ -786,7 +789,7 @@ acllog-max-len 128
+@@ -787,7 +790,7 @@ acllog-max-len 128
  # AUTH <password> as usually, or more explicitly with AUTH default <password>
  # if they follow the new protocol: both will work.
  #
@@ -117,7 +117,7 @@ Index: redis.conf
  
  # Command renaming (DEPRECATED).
  #
-@@ -830,6 +833,7 @@ acllog-max-len 128
+@@ -831,6 +834,7 @@ acllog-max-len 128
  # limit accordingly in case of very large clusters.
  #
  # maxclients 10000
Index: patches/patch-src_Makefile
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-src_Makefile,v
retrieving revision 1.35
diff -u -p -r1.35 patch-src_Makefile
--- patches/patch-src_Makefile  11 Sep 2020 13:54:01 -0000      1.35
+++ patches/patch-src_Makefile  27 Oct 2020 12:59:32 -0000
@@ -44,7 +44,7 @@ Index: src/Makefile
  endif
  endif
  
-@@ -149,7 +150,7 @@ endif
+@@ -166,7 +167,7 @@ endif
  endif
  endif
  # Include paths to dependencies
@@ -53,16 +53,16 @@ Index: src/Makefile
  
  # Determine systemd support and/or build preference (defaulting to 
auto-detection)
  BUILD_WITH_SYSTEMD=no
-@@ -236,6 +237,8 @@ REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adli
- REDIS_CHECK_RDB_NAME=redis-check-rdb
- REDIS_CHECK_AOF_NAME=redis-check-aof
+@@ -253,6 +254,8 @@ REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adli
+ REDIS_CHECK_RDB_NAME=redis-check-rdb$(PROG_SUFFIX)
+ REDIS_CHECK_AOF_NAME=redis-check-aof$(PROG_SUFFIX)
  
 +REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o 
lua_struct.o
 +
  all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) 
$(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME)
        @echo ""
        @echo "Hint: It's a good idea to run 'make test' ;)"
-@@ -282,7 +285,7 @@ endif
+@@ -299,7 +302,7 @@ endif
  
  # redis-server
  $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
@@ -71,7 +71,7 @@ Index: src/Makefile
  
  # redis-sentinel
  $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
-@@ -329,7 +332,7 @@ distclean: clean
+@@ -346,7 +349,7 @@ distclean: clean
  .PHONY: distclean
  
  test: $(REDIS_SERVER_NAME) $(REDIS_CHECK_AOF_NAME)
@@ -80,7 +80,7 @@ Index: src/Makefile
  
  test-sentinel: $(REDIS_SENTINEL_NAME)
        @(cd ..; ./runtest-sentinel)
-@@ -373,13 +376,14 @@ src/help.h:
+@@ -390,13 +393,14 @@ src/help.h:
        @../utils/generate-command-help.rb > help.h
  
  install: all
Index: patches/patch-src_debug_c
===================================================================
RCS file: patches/patch-src_debug_c
diff -N patches/patch-src_debug_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_debug_c   27 Oct 2020 12:59:32 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+time_t is long long on OpenBSD
+
+Index: src/debug.c
+--- src/debug.c.orig
++++ src/debug.c
+@@ -408,7 +408,7 @@ NULL
+     } else if (!strcasecmp(c->argv[1]->ptr,"segfault")) {
+         *((char*)-1) = 'x';
+     } else if (!strcasecmp(c->argv[1]->ptr,"panic")) {
+-        serverPanic("DEBUG PANIC called at Unix time %ld", time(NULL));
++        serverPanic("DEBUG PANIC called at Unix time %lld", time(NULL));
+     } else if (!strcasecmp(c->argv[1]->ptr,"restart") ||
+                !strcasecmp(c->argv[1]->ptr,"crash-and-recover"))
+     {
Index: patches/patch-src_networking_c
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-src_networking_c,v
retrieving revision 1.4
diff -u -p -r1.4 patch-src_networking_c
--- patches/patch-src_networking_c      3 Sep 2020 04:29:27 -0000       1.4
+++ patches/patch-src_networking_c      27 Oct 2020 12:59:32 -0000
@@ -5,7 +5,7 @@ time_t is long long, so use llabs to avo
 Index: src/networking.c
 --- src/networking.c.orig
 +++ src/networking.c
-@@ -2606,7 +2606,7 @@ void securityWarningCommand(client *c) {
+@@ -2651,7 +2651,7 @@ void securityWarningCommand(client *c) {
      static time_t logged_time;
      time_t now = time(NULL);
  
Index: patches/patch-src_zmalloc_c
===================================================================
RCS file: patches/patch-src_zmalloc_c
diff -N patches/patch-src_zmalloc_c
--- patches/patch-src_zmalloc_c 8 Jun 2020 07:32:47 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-$OpenBSD: patch-src_zmalloc_c,v 1.2 2020/06/08 07:32:47 tb Exp $
-
-zmalloc_size() returns a lie based on the following assumption:
-
-    /* Assume at least that all the allocations are padded at sizeof(long) by
-     * the underlying allocator. */
-
-Make that lie a reality by rounding up the actually allocated sizes.
-
-Index: src/zmalloc.c
---- src/zmalloc.c.orig
-+++ src/zmalloc.c
-@@ -56,6 +56,13 @@ void zlibc_free(void *ptr) {
- #endif
- #endif
- 
-+static size_t zmalloc_roundsize(size_t size) {
-+#ifndef HAVE_MALLOC_SIZE
-+     if (size&(sizeof(long)-1)) size += sizeof(long)-(size&(sizeof(long)-1));
-+#endif
-+     return size;
-+}
-+
- /* Explicitly override malloc/free etc when using tcmalloc. */
- #if defined(USE_TCMALLOC)
- #define malloc(size) tc_malloc(size)
-@@ -96,8 +103,11 @@ static void zmalloc_default_oom(size_t size) {
- static void (*zmalloc_oom_handler)(size_t) = zmalloc_default_oom;
- 
- void *zmalloc(size_t size) {
--    void *ptr = malloc(size+PREFIX_SIZE);
-+    void *ptr;
- 
-+    size = zmalloc_roundsize(size);
-+    ptr = malloc(size+PREFIX_SIZE);
-+
-     if (!ptr) zmalloc_oom_handler(size);
- #ifdef HAVE_MALLOC_SIZE
-     update_zmalloc_stat_alloc(zmalloc_size(ptr));
-@@ -128,8 +138,11 @@ void zfree_no_tcache(void *ptr) {
- #endif
- 
- void *zcalloc(size_t size) {
--    void *ptr = calloc(1, size+PREFIX_SIZE);
-+    void *ptr;
- 
-+    size = zmalloc_roundsize(size);
-+    ptr = calloc(1, size+PREFIX_SIZE);
-+
-     if (!ptr) zmalloc_oom_handler(size);
- #ifdef HAVE_MALLOC_SIZE
-     update_zmalloc_stat_alloc(zmalloc_size(ptr));
-@@ -152,6 +165,9 @@ void *zrealloc(void *ptr, size_t size) {
-         zfree(ptr);
-         return NULL;
-     }
-+
-+    size = zmalloc_roundsize(size);
-+
-     if (ptr == NULL) return zmalloc(size);
- #ifdef HAVE_MALLOC_SIZE
-     oldsize = zmalloc_size(ptr);

Reply via email to