[update] Redis 6.2.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[update] Redis 6.2.0

Theo Buehler-3
So danj conned me into looking at Redis again...

This is a major upgrade from the 6.0 branch, but as the releaese notes
put it:

  Redis 6.2 includes many new commands and improvements, but no big features. It
  mainly makes Redis more complete and addresses issues that have been requested
  by many users frequently or for a long time.

Details: https://github.com/redis/redis/blob/6.2/00-RELEASENOTES

Especially:

* Command behavior changes
* Other behavior changes

ILP32 arches have a buffer overflow due to missing checks in zmalloc.c
which are addressed in this release. Unfortunately, I needed add a patch
because their fix doesn't compile with USE_JEMALLOC=no.  Upstream will
include a similar fix to mine in a subsequent release.

I replaced some lua related patches with sed + CFLAGS and dropped two
hunks in our diff to deps/Makefile which tended to produce conflicts.

I also decided to move the server and the sentinel from sbin to bin to
avoid some Makefile patching that conflicted more than once (the new
symlinks would have added complexity to that hunk).

The port still patches a lot more than I would like it to.

I ran tests on amd64 and sparc64.

Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/redis/Makefile,v
retrieving revision 1.118
diff -u -p -r1.118 Makefile
--- Makefile 23 Jan 2021 14:58:19 -0000 1.118
+++ Makefile 23 Feb 2021 16:19:53 -0000
@@ -1,7 +1,8 @@
 # $OpenBSD: Makefile,v 1.118 2021/01/23 14:58:19 danj Exp $
 
 COMMENT = persistent key-value database
-DISTNAME = redis-6.0.10
+
+DISTNAME = redis-6.2.0
 CATEGORIES = databases
 HOMEPAGE = https://redis.io/
 
@@ -30,6 +31,8 @@ MAKE_FLAGS = BUILD_TLS=yes \
  OPTIMIZATION="" \
  V=1
 
+CFLAGS += -I${MODLUA_INCL_DIR}
+
 # Fix "undefined reference to `__atomic_store_8'"
 .if ${MACHINE_ARCH:Mhppa}
 WANTLIB += atomic
@@ -49,12 +52,15 @@ TEST_FLAGS = TCL_BIN="${MODTCL_BIN}"
 DBDIR = ${VARBASE}/redis
 SUBST_VARS += DBDIR
 
-pre-configure:
+post-patch:
  cp ${WRKSRC}/deps/lua/src/fpconv.? ${WRKSRC}/src/
  cp ${WRKSRC}/deps/lua/src/strbuf.? ${WRKSRC}/src/
  cp ${WRKSRC}/deps/lua/src/lua_*.c ${WRKSRC}/src/
- rm -rf ${WRKSRC}/deps/jemalloc
- rm -rf ${WRKSRC}/deps/lua
+ sed -i -E 's/^#include "(lua|lauxlib)\.h"/#include <\1.h>/' \
+ ${WRKSRC}/src/lua_*.c
+ unifdef -x 1 -m -DENABLE_CJSON_GLOBAL ${WRKSRC}/src/lua_cjson.c
+
+pre-configure:
  ${SUBST_CMD} ${WRKSRC}/src/Makefile
 
 post-install:
Index: distinfo
===================================================================
RCS file: /cvs/ports/databases/redis/distinfo,v
retrieving revision 1.92
diff -u -p -r1.92 distinfo
--- distinfo 23 Jan 2021 14:58:19 -0000 1.92
+++ distinfo 23 Feb 2021 14:54:34 -0000
@@ -1,2 +1,2 @@
-SHA256 (redis-6.0.10.tar.gz) = ebu4lPnc6zPKaZ7jykpOEii+f7VUeusvmdkh6GwShb0=
-SIZE (redis-6.0.10.tar.gz) = 2271970
+SHA256 (redis-6.2.0.tar.gz) = Z9Ykwl2WK9aK/4gSoTXfhbrQdVa4gl87zVtSKpky28o=
+SIZE (redis-6.2.0.tar.gz) = 2435539
Index: patches/patch-deps_Makefile
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-deps_Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 patch-deps_Makefile
--- patches/patch-deps_Makefile 8 Jun 2020 07:32:47 -0000 1.12
+++ patches/patch-deps_Makefile 23 Feb 2021 14:38:37 -0000
@@ -1,17 +1,9 @@
 $OpenBSD: patch-deps_Makefile,v 1.12 2020/06/08 07:32:47 tb Exp $
+
 Index: deps/Makefile
 --- deps/Makefile.orig
 +++ deps/Makefile
-@@ -35,8 +35,6 @@ endif
- distclean:
- -(cd hiredis && $(MAKE) clean) > /dev/null || true
- -(cd linenoise && $(MAKE) clean) > /dev/null || true
-- -(cd lua && $(MAKE) clean) > /dev/null || true
-- -(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true
- -(rm -f .make-*)
-
- .PHONY: distclean
-@@ -46,42 +44,11 @@ ifeq ($(BUILD_TLS),yes)
+@@ -47,19 +47,16 @@ ifeq ($(BUILD_TLS),yes)
  endif
 
  hiredis: .make-prerequisites
@@ -25,32 +17,9 @@ Index: deps/Makefile
  cd linenoise && $(MAKE)
 
  .PHONY: linenoise
--
--ifeq ($(uname_S),SunOS)
-- # Make isinf() available
-- LUA_CFLAGS= -D__C99FEATURES__=1
--endif
--
--LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' $(CFLAGS)
--LUA_LDFLAGS+= $(LDFLAGS)
--# lua's Makefile defines AR="ar rcu", which is unusual, and makes it more
--# challenging to cross-compile lua (and redis).  These defines make it easier
--# to fit redis into cross-compilation environments, which typically set AR.
--AR=ar
--ARFLAGS=rcu
--
--lua: .make-prerequisites
-- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
-- cd lua/src && $(MAKE) all CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)" AR="$(AR) $(ARFLAGS)"
--
--.PHONY: lua
--
--JEMALLOC_CFLAGS= -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops $(CFLAGS)
--JEMALLOC_LDFLAGS= $(LDFLAGS)
--
--jemalloc: .make-prerequisites
+
+ hdr_histogram: .make-prerequisites
 - @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
-- cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
-- cd jemalloc && $(MAKE) CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" lib/libjemalloc.a
--
--.PHONY: jemalloc
+ cd hdr_histogram && $(MAKE)
+
+ .PHONY: hdr_histogram
Index: patches/patch-deps_hiredis_Makefile
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-deps_hiredis_Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 patch-deps_hiredis_Makefile
--- patches/patch-deps_hiredis_Makefile 8 Jun 2020 07:32:47 -0000 1.9
+++ patches/patch-deps_hiredis_Makefile 23 Feb 2021 08:26:33 -0000
@@ -1,8 +1,9 @@
 $OpenBSD: patch-deps_hiredis_Makefile,v 1.9 2020/06/08 07:32:47 tb Exp $
+
 Index: deps/hiredis/Makefile
 --- deps/hiredis/Makefile.orig
 +++ deps/hiredis/Makefile
-@@ -71,7 +71,7 @@ ifeq ($(USE_SSL),1)
+@@ -76,7 +76,7 @@ ifeq ($(USE_SSL),1)
    CFLAGS+=-DHIREDIS_TEST_SSL
  endif
 
@@ -11,12 +12,12 @@ Index: deps/hiredis/Makefile
    SSL_LDFLAGS=-lssl -lcrypto
  else
    OPENSSL_PREFIX?=/usr/local/opt/openssl
-@@ -236,7 +236,7 @@ $(SSL_PKGCONFNAME): hiredis.h
+@@ -258,7 +258,7 @@ $(SSL_PKGCONFNAME): hiredis_ssl.h
  @echo Libs.private: -lssl -lcrypto >> $@
 
  install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME)
 - mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH)
 + $(INSTALL_DIR) $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH)
- $(INSTALL) hiredis.h async.h read.h sds.h $(INSTALL_INCLUDE_PATH)
+ $(INSTALL) hiredis.h async.h read.h sds.h alloc.h $(INSTALL_INCLUDE_PATH)
  $(INSTALL) adapters/*.h $(INSTALL_INCLUDE_PATH)/adapters
  $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
Index: patches/patch-deps_lua_src_lua_bit_c
===================================================================
RCS file: patches/patch-deps_lua_src_lua_bit_c
diff -N patches/patch-deps_lua_src_lua_bit_c
--- patches/patch-deps_lua_src_lua_bit_c 5 Dec 2014 09:33:09 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-deps_lua_src_lua_bit_c,v 1.1 2014/12/05 09:33:09 dcoppa Exp $
---- deps/lua/src/lua_bit.c.orig Fri Dec  5 03:06:08 2014
-+++ deps/lua/src/lua_bit.c Fri Dec  5 03:06:35 2014
-@@ -29,8 +29,8 @@
- #define LUA_BITOP_VERSION "1.0.2"
-
- #define LUA_LIB
--#include "lua.h"
--#include "lauxlib.h"
-+#include <lua.h>
-+#include <lauxlib.h>
-
- #ifdef _MSC_VER
- /* MSVC is stuck in the last century and doesn't have C99's stdint.h. */
Index: patches/patch-deps_lua_src_lua_cjson_c
===================================================================
RCS file: patches/patch-deps_lua_src_lua_cjson_c
diff -N patches/patch-deps_lua_src_lua_cjson_c
--- patches/patch-deps_lua_src_lua_cjson_c 5 Dec 2014 09:33:09 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-$OpenBSD: patch-deps_lua_src_lua_cjson_c,v 1.2 2014/12/05 09:33:09 dcoppa Exp $
---- deps/lua/src/lua_cjson.c.orig Thu Dec  4 04:36:52 2014
-+++ deps/lua/src/lua_cjson.c Fri Dec  5 02:58:23 2014
-@@ -40,13 +40,13 @@
- #include <string.h>
- #include <math.h>
- #include <limits.h>
--#include "lua.h"
--#include "lauxlib.h"
-+#include <lua.h>
-+#include <lauxlib.h>
-
- #include "strbuf.h"
- #include "fpconv.h"
-
--#include "../../../src/solarisfixes.h"
-+#include "solarisfixes.h"
-
- #ifndef CJSON_MODNAME
- #define CJSON_MODNAME   "cjson"
-@@ -1405,11 +1405,9 @@ int luaopen_cjson(lua_State *l)
- {
-     lua_cjson_new(l);
-
--#ifdef ENABLE_CJSON_GLOBAL
-     /* Register a global "cjson" table. */
-     lua_pushvalue(l, -1);
-     lua_setglobal(l, CJSON_MODNAME);
--#endif
-
-     /* Return cjson table */
-     return 1;
Index: patches/patch-deps_lua_src_lua_cmsgpack_c
===================================================================
RCS file: patches/patch-deps_lua_src_lua_cmsgpack_c
diff -N patches/patch-deps_lua_src_lua_cmsgpack_c
--- patches/patch-deps_lua_src_lua_cmsgpack_c 5 Dec 2014 09:33:09 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-deps_lua_src_lua_cmsgpack_c,v 1.2 2014/12/05 09:33:09 dcoppa Exp $
---- deps/lua/src/lua_cmsgpack.c.orig Thu Dec  4 04:36:52 2014
-+++ deps/lua/src/lua_cmsgpack.c Fri Dec  5 02:30:05 2014
-@@ -4,8 +4,8 @@
- #include <string.h>
- #include <assert.h>
-
--#include "lua.h"
--#include "lauxlib.h"
-+#include <lua.h>
-+#include <lauxlib.h>
-
- #define LUACMSGPACK_NAME        "cmsgpack"
- #define LUACMSGPACK_SAFE_NAME   "cmsgpack_safe"
Index: patches/patch-deps_lua_src_lua_struct_c
===================================================================
RCS file: patches/patch-deps_lua_src_lua_struct_c
diff -N patches/patch-deps_lua_src_lua_struct_c
--- patches/patch-deps_lua_src_lua_struct_c 14 Mar 2013 09:00:39 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-deps_lua_src_lua_struct_c,v 1.2 2013/03/14 09:00:39 dcoppa Exp $
---- deps/lua/src/lua_struct.c.orig Mon Mar 11 19:51:10 2013
-+++ deps/lua/src/lua_struct.c Thu Mar 14 09:28:12 2013
-@@ -33,8 +33,8 @@
- #include <string.h>
-
-
--#include "lua.h"
--#include "lauxlib.h"
-+#include <lua.h>
-+#include <lauxlib.h>
-
-
- #if (LUA_VERSION_NUM >= 502)
Index: patches/patch-redis_conf
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-redis_conf,v
retrieving revision 1.24
diff -u -p -r1.24 patch-redis_conf
--- patches/patch-redis_conf 29 Oct 2020 05:14:03 -0000 1.24
+++ patches/patch-redis_conf 23 Feb 2021 08:26:33 -0000
@@ -13,18 +13,18 @@ Main changes in this file:
 Index: redis.conf
 --- redis.conf.orig
 +++ redis.conf
-@@ -105,8 +105,8 @@ tcp-backlog 511
+@@ -112,8 +112,8 @@ tcp-backlog 511
  # incoming connections. There is no default, so Redis will not listen
  # on a unix socket when not specified.
  #
--# unixsocket /tmp/redis.sock
+-# unixsocket /run/redis.sock
 -# unixsocketperm 700
 +# unixsocket /var/run/redis/redis.sock
 +# unixsocketperm 770
 
  # Close the connection after a client is idle for N seconds (0 to disable)
  timeout 0
-@@ -153,6 +153,7 @@ tcp-keepalive 300
+@@ -172,6 +172,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
-@@ -183,14 +184,14 @@ tcp-keepalive 300
+@@ -205,14 +206,14 @@ tcp-keepalive 300
  #
  # tls-protocols "TLSv1.2 TLSv1.3"
 
@@ -49,19 +49,19 @@ Index: redis.conf
  # information about the syntax of this string, and specifically for TLSv1.3
  # ciphersuites.
  #
-@@ -220,8 +221,9 @@ tcp-keepalive 300
+@@ -242,9 +243,9 @@ tcp-keepalive 300
  ################################# GENERAL #####################################
 
  # By default Redis does not run as a daemon. Use 'yes' if you need it.
 -# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
++# Note that Redis will write a pid file in /var/run/redis/redis.pid when daemonized.
+ # When Redis is supervised by upstart or systemd, this parameter has no impact.
 -daemonize no
-+# Note that Redis will write a pid file in /var/run/redis/redis.pid
-+# when daemonized.
 +daemonize yes
 
  # If you run Redis from upstart or systemd, Redis can interact with your
  # supervision tree. Options:
-@@ -240,11 +242,11 @@ supervised no
+@@ -269,14 +270,14 @@ daemonize no
  #
  # When the server runs non daemonized, no pid file is created if none is
  # specified in the configuration. When the server is daemonized, the pid file
@@ -70,12 +70,15 @@ Index: redis.conf
  #
  # Creating a pid file is best effort: if Redis is not able to create it
  # nothing bad happens, the server will start and run normally.
+ #
+ # Note that on modern Linux systems "/run/redis.pid" is more conforming
+ # and should be used instead.
 -pidfile /var/run/redis_6379.pid
 +pidfile /var/run/redis/redis_6379.pid
 
  # Specify the server verbosity level.
  # This can be one of:
-@@ -257,17 +259,18 @@ loglevel notice
+@@ -289,17 +290,18 @@ loglevel notice
  # Specify the log file name. Also the empty string can be used to force
  # Redis to log on the standard output. Note that if you use standard
  # output for logging but daemonize, logs will be sent to /dev/null
@@ -97,9 +100,9 @@ Index: redis.conf
 +# LOCAL0-LOCAL7.
 +syslog-facility daemon
 
- # Set the number of databases. The default database is DB 0, you can select
- # a different one on a per-connection basis using SELECT <dbid> where
-@@ -362,7 +365,7 @@ rdb-del-sync-files no
+ # To disable the built in crash log, which will possibly produce cleaner core
+ # dumps when they are needed, uncomment the following:
+@@ -441,7 +443,7 @@ rdb-del-sync-files no
  # The Append Only File will also be created inside this directory.
  #
  # Note that you must specify a directory here, not a file name.
@@ -108,16 +111,16 @@ Index: redis.conf
 
  ################################# REPLICATION #################################
 
-@@ -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.
+@@ -876,7 +878,7 @@ acllog-max-len 128
+ # The requirepass is not compatable with aclfile option and the ACL LOAD
+ # command, these will cause requirepass to be ignored.
  #
 -# requirepass foobared
 +# requirepass very-strong-password
 
- # Command renaming (DEPRECATED).
- #
-@@ -831,6 +834,7 @@ acllog-max-len 128
+ # New users are initialized with restrictive permissions by default, via the
+ # equivalent of this ACL rule 'off resetkeys -@all'. Starting with Redis 6.2, it
+@@ -941,6 +943,7 @@ acllog-max-len 128
  # limit accordingly in case of very large clusters.
  #
  # maxclients 10000
Index: patches/patch-sentinel_conf
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-sentinel_conf,v
retrieving revision 1.8
diff -u -p -r1.8 patch-sentinel_conf
--- patches/patch-sentinel_conf 8 Jun 2020 07:32:47 -0000 1.8
+++ patches/patch-sentinel_conf 23 Feb 2021 08:26:33 -0000
@@ -1,4 +1,5 @@
 $OpenBSD: patch-sentinel_conf,v 1.8 2020/06/08 07:32:47 tb Exp $
+
 Index: sentinel.conf
 --- sentinel.conf.orig
 +++ sentinel.conf
@@ -20,7 +21,7 @@ Index: sentinel.conf
 
  # Specify the log file name. Also the empty string can be used to force
  # Sentinel to log on the standard output. Note that if you use standard
-@@ -202,7 +202,7 @@ sentinel failover-timeout mymaster 180000
+@@ -261,7 +261,7 @@ sentinel failover-timeout mymaster 180000
  #
  # Example:
  #
@@ -29,7 +30,7 @@ Index: sentinel.conf
 
  # CLIENTS RECONFIGURATION SCRIPT
  #
-@@ -227,7 +227,7 @@ sentinel failover-timeout mymaster 180000
+@@ -286,7 +286,7 @@ sentinel failover-timeout mymaster 180000
  #
  # Example:
  #
Index: patches/patch-src_Makefile
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-src_Makefile,v
retrieving revision 1.36
diff -u -p -r1.36 patch-src_Makefile
--- patches/patch-src_Makefile 29 Oct 2020 05:14:03 -0000 1.36
+++ patches/patch-src_Makefile 23 Feb 2021 15:24:49 -0000
@@ -1,8 +1,7 @@
 $OpenBSD: patch-src_Makefile,v 1.36 2020/10/29 05:14:03 tb Exp $
 
 Changes in this file:
-- install redis-server and redis-sentinel into ${PREFIX}/sbin
-- don't use jemalloc and bundled lua; use lua from ports.
+- use lua from ports.
 - do not use -funwind-tables and -latomic on armv7
 - run tests with datasize, fds, stacksize and processes at the hard limit
 
@@ -13,12 +12,12 @@ Index: src/Makefile
  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
  OPTIMIZATION?=-O2
--DEPENDENCY_TARGETS=hiredis linenoise lua
-+DEPENDENCY_TARGETS=hiredis linenoise
+-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram
++DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram
  NODEPS:=clean distclean
 
  # Default settings
-@@ -31,6 +31,7 @@ OPT=$(OPTIMIZATION)
+@@ -41,6 +41,7 @@ endif
 
  PREFIX?=/usr/local
  INSTALL_BIN=$(PREFIX)/bin
@@ -26,7 +25,7 @@ Index: src/Makefile
  INSTALL=install
  PKG_CONFIG?=pkg-config
 
-@@ -49,7 +50,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
+@@ -59,7 +60,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
          CFLAGS+=-funwind-tables
  else
  ifneq (,$(findstring armv,$(uname_M)))
@@ -35,7 +34,7 @@ Index: src/Makefile
  endif
  endif
 
-@@ -83,7 +84,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
+@@ -93,7 +94,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
          FINAL_LIBS+=-latomic
  else
  ifneq (,$(findstring armv,$(uname_M)))
@@ -44,16 +43,7 @@ Index: src/Makefile
  endif
  endif
 
-@@ -166,7 +167,7 @@ endif
- endif
- endif
- # Include paths to dependencies
--FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
-+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I${MODLUA_INCL_DIR}
-
- # Determine systemd support and/or build preference (defaulting to auto-detection)
- BUILD_WITH_SYSTEMD=no
-@@ -253,6 +254,8 @@ REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adli
+@@ -278,6 +279,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)
 
@@ -62,7 +52,7 @@ Index: src/Makefile
  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' ;)"
-@@ -299,7 +302,7 @@ endif
+@@ -324,7 +327,7 @@ endif
 
  # redis-server
  $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
@@ -71,30 +61,21 @@ Index: src/Makefile
 
  # redis-sentinel
  $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
-@@ -346,7 +349,7 @@ distclean: clean
+@@ -371,7 +374,7 @@ distclean: clean
  .PHONY: distclean
 
- test: $(REDIS_SERVER_NAME) $(REDIS_CHECK_AOF_NAME)
+ test: $(REDIS_SERVER_NAME) $(REDIS_CHECK_AOF_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME)
 - @(cd ..; ./runtest)
 + @(cd ..; ulimit -Sd `ulimit -Hd`; ulimit -Sn `ulimit -Hn`; ulimit -Sp `ulimit -Hp`; ulimit -Ss `ulimit -Hs`; ${TCL_BIN} tests/test_helper.tcl)
 
- test-sentinel: $(REDIS_SENTINEL_NAME)
+ test-sentinel: $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME)
  @(cd ..; ./runtest-sentinel)
-@@ -390,13 +393,14 @@ src/help.h:
+@@ -411,7 +414,7 @@ src/help.h:
  @../utils/generate-command-help.rb > help.h
 
  install: all
 - @mkdir -p $(INSTALL_BIN)
-- $(REDIS_INSTALL) $(REDIS_SERVER_NAME) $(INSTALL_BIN)
-+ $(INSTALL_DIR) $(INSTALL_SBIN)
-+ $(REDIS_INSTALL) $(REDIS_SERVER_NAME) $(INSTALL_SBIN)
 + $(INSTALL_DIR) $(INSTALL_BIN)
+ $(REDIS_INSTALL) $(REDIS_SERVER_NAME) $(INSTALL_BIN)
  $(REDIS_INSTALL) $(REDIS_BENCHMARK_NAME) $(INSTALL_BIN)
  $(REDIS_INSTALL) $(REDIS_CLI_NAME) $(INSTALL_BIN)
- $(REDIS_INSTALL) $(REDIS_CHECK_RDB_NAME) $(INSTALL_BIN)
- $(REDIS_INSTALL) $(REDIS_CHECK_AOF_NAME) $(INSTALL_BIN)
-- @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_SENTINEL_NAME)
-+ @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_SBIN)/$(REDIS_SENTINEL_NAME)
-
- uninstall:
- rm -f $(INSTALL_BIN)/{$(REDIS_SERVER_NAME),$(REDIS_BENCHMARK_NAME),$(REDIS_CLI_NAME),$(REDIS_CHECK_RDB_NAME),$(REDIS_CHECK_AOF_NAME),$(REDIS_SENTINEL_NAME)}
Index: patches/patch-src_debug_c
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-src_debug_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_debug_c
--- patches/patch-src_debug_c 29 Oct 2020 05:14:04 -0000 1.3
+++ patches/patch-src_debug_c 23 Feb 2021 08:26:33 -0000
@@ -5,7 +5,7 @@ time_t is long long on OpenBSD
 Index: src/debug.c
 --- src/debug.c.orig
 +++ src/debug.c
-@@ -408,7 +408,7 @@ NULL
+@@ -469,7 +469,7 @@ NULL
      } else if (!strcasecmp(c->argv[1]->ptr,"segfault")) {
          *((char*)-1) = 'x';
      } else if (!strcasecmp(c->argv[1]->ptr,"panic")) {
Index: patches/patch-src_networking_c
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-src_networking_c,v
retrieving revision 1.6
diff -u -p -r1.6 patch-src_networking_c
--- patches/patch-src_networking_c 23 Jan 2021 14:58:19 -0000 1.6
+++ patches/patch-src_networking_c 23 Feb 2021 14:54:58 -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
-@@ -2689,7 +2689,7 @@ void securityWarningCommand(client *c) {
+@@ -3007,7 +3007,7 @@ void securityWarningCommand(client *c) {
      static time_t logged_time;
      time_t now = time(NULL);
 
Index: patches/patch-src_server_h
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-src_server_h,v
retrieving revision 1.5
diff -u -p -r1.5 patch-src_server_h
--- patches/patch-src_server_h 8 Jun 2020 07:32:47 -0000 1.5
+++ patches/patch-src_server_h 23 Feb 2021 08:26:33 -0000
@@ -1,8 +1,9 @@
 $OpenBSD: patch-src_server_h,v 1.5 2020/06/08 07:32:47 tb Exp $
+
 Index: src/server.h
 --- src/server.h.orig
 +++ src/server.h
-@@ -106,7 +106,7 @@ typedef long long ustime_t; /* microsecond time type.
+@@ -107,7 +107,7 @@ typedef long long ustime_t; /* microsecond time type.
  #define RDB_EOF_MARK_SIZE 40
  #define CONFIG_REPL_BACKLOG_MIN_SIZE (1024*16)          /* 16k */
  #define CONFIG_BGSAVE_RETRY_DELAY 5 /* Wait a few secs before trying again. */
Index: patches/patch-src_zmalloc_c
===================================================================
RCS file: patches/patch-src_zmalloc_c
diff -N patches/patch-src_zmalloc_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_zmalloc_c 23 Feb 2021 14:37:00 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+https://github.com/redis/redis/issues/8531
+
+Index: src/zmalloc.c
+--- src/zmalloc.c.orig
++++ src/zmalloc.c
+@@ -28,6 +28,7 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+
++#include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+@@ -57,7 +58,7 @@ void zlibc_free(void *ptr) {
+ #endif
+ #endif
+
+-#if PREFIX_SIZE > 0
++#ifndef HAVE_MALLOC_SIZE
+ #define ASSERT_NO_SIZE_OVERFLOW(sz) assert((sz) + PREFIX_SIZE > (sz))
+ #else
+ #define ASSERT_NO_SIZE_OVERFLOW(sz)
Index: patches/patch-tests_test_helper_tcl
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-tests_test_helper_tcl,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tests_test_helper_tcl
--- patches/patch-tests_test_helper_tcl 8 Sep 2020 05:51:53 -0000 1.2
+++ patches/patch-tests_test_helper_tcl 23 Feb 2021 08:26:33 -0000
@@ -8,7 +8,7 @@ rdb child didn't terminate
 Index: tests/test_helper.tcl
 --- tests/test_helper.tcl.orig
 +++ tests/test_helper.tcl
-@@ -37,7 +37,6 @@ set ::all_tests {
+@@ -38,7 +38,6 @@ set ::all_tests {
      unit/acl
      unit/latency-monitor
      integration/block-repl
Index: patches/patch-utils_gen-test-certs_sh
===================================================================
RCS file: /cvs/ports/databases/redis/patches/patch-utils_gen-test-certs_sh,v
retrieving revision 1.1
diff -u -p -r1.1 patch-utils_gen-test-certs_sh
--- patches/patch-utils_gen-test-certs_sh 8 Jun 2020 07:32:47 -0000 1.1
+++ patches/patch-utils_gen-test-certs_sh 23 Feb 2021 08:26:33 -0000
@@ -6,6 +6,6 @@ Index: utils/gen-test-certs.sh
 @@ -1,4 +1,4 @@
 -#!/bin/bash
 +#!/bin/sh
- mkdir -p tests/tls
- openssl genrsa -out tests/tls/ca.key 4096
- openssl req \
+
+ # Generate some test certificates which are used by the regression test suite:
+ #
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/databases/redis/pkg/PLIST,v
retrieving revision 1.11
diff -u -p -r1.11 PLIST
--- pkg/PLIST 2 Sep 2018 11:08:51 -0000 1.11
+++ pkg/PLIST 23 Feb 2021 15:26:23 -0000
@@ -3,11 +3,11 @@
 @newuser _redis:686:_redis:daemon:redis account:${DBDIR}:/sbin/nologin
 @rcscript ${RCDIR}/redis
 @bin bin/redis-benchmark
-@bin bin/redis-check-aof
-@bin bin/redis-check-rdb
+bin/redis-check-aof
+bin/redis-check-rdb
 @bin bin/redis-cli
-sbin/redis-sentinel
-@bin sbin/redis-server
+bin/redis-sentinel
+@bin bin/redis-server
 share/examples/redis/
 @sample ${SYSCONFDIR}/redis/
 share/examples/redis/redis.conf
Index: pkg/redis.rc
===================================================================
RCS file: /cvs/ports/databases/redis/pkg/redis.rc,v
retrieving revision 1.6
diff -u -p -r1.6 redis.rc
--- pkg/redis.rc 11 Jan 2018 19:27:02 -0000 1.6
+++ pkg/redis.rc 23 Feb 2021 15:35:26 -0000
@@ -2,7 +2,7 @@
 #
 # $OpenBSD: redis.rc,v 1.6 2018/01/11 19:27:02 rpe Exp $
 
-daemon="${TRUEPREFIX}/sbin/redis-server"
+daemon="${TRUEPREFIX}/bin/redis-server"
 daemon_flags="${SYSCONFDIR}/redis/redis.conf"
 daemon_user="_redis"
 

Reply | Threaded
Open this post in threaded view
|

Re: [update] Redis 6.2.0

Daniel Jakots-6
On Tue, 23 Feb 2021 17:21:46 +0100, Theo Buehler <[hidden email]>
wrote:

> So danj conned me into looking at Redis again...

Thank you so much!

> I replaced some lua related patches with sed + CFLAGS and dropped two
> hunks in our diff to deps/Makefile which tended to produce conflicts.

Awesome!

> I also decided to move the server and the sentinel from sbin to bin to
> avoid some Makefile patching that conflicted more than once (the new
> symlinks would have added complexity to that hunk).

Yeah f those patches. I spent too much time on this conflicts.

Index: patches/patch-src_zmalloc_c
> ===================================================================
> RCS file: patches/patch-src_zmalloc_c
> diff -N patches/patch-src_zmalloc_c

Can we go instead with upstream diff (since we're going to run it
sooner or later)?

$OpenBSD$

Backport from upstream:
https://github.com/redis/redis/pull/8533/commits/cdfa9601d7b374b3ef6859a4c093046ad331f903

Index: src/zmalloc.c
--- src/zmalloc.c.orig
+++ src/zmalloc.c
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
+#include <assert.h>
 
 /* This function provide us access to the original libc free(). This is useful
  * for instance to free results obtained by backtrace_symbols(). We need
@@ -49,18 +50,14 @@ void zlibc_free(void *ptr) {
 
 #ifdef HAVE_MALLOC_SIZE
 #define PREFIX_SIZE (0)
+#define ASSERT_NO_SIZE_OVERFLOW(sz)
 #else
 #if defined(__sun) || defined(__sparc) || defined(__sparc__)
 #define PREFIX_SIZE (sizeof(long long))
 #else
 #define PREFIX_SIZE (sizeof(size_t))
 #endif
-#endif
-
-#if PREFIX_SIZE > 0
 #define ASSERT_NO_SIZE_OVERFLOW(sz) assert((sz) + PREFIX_SIZE > (sz))
-#else
-#define ASSERT_NO_SIZE_OVERFLOW(sz)
 #endif
 
 /* Explicitly override malloc/free etc when using tcmalloc. */



(ftp -o /usr/ports/databases/redis/patches/patch-src_zmalloc_c
https://static.chown.me/private/paste/e89b08cfaa638fd0c8a424a382ecd6cd9a60639473053314ca65553ee3eb4072
if it helps)

ok danj@ either way

Cheers,
Daniel