Skip to contentSkip to conversation

valkey: Add recipe

PATCH New Leon Anavi 1 participant 1 message Sep 26, 2024

lore
Share & tools
lore

Leon Anavi

author
#0 lore raw

PATCH v2 1/1 valkey: Add recipe

Valkey is an open source, in-memory data store. Release 8.0.0 is fully compatible with Redis OSS 7.2.4 and brings:

- Added full client info to SHUTDOWN and CLUSTER FAILOVER logs for better traceability of requests.
- Resolved issues in replicationSetPrimary where the primary node's IP/port updates were not correctly handled in the cluster gossip section.
- Fixed AOF base suffix during rewrites when modifying the aof-use-rdb-preamble setting, ensuring correct suffix caching to prevent inconsistencies.
- Addressed rare crashes in async IO threads with TLS by preventing concurrent read and write job overlap.
- Prevented AOF from being incorrectly disabled after loading RDB data, ensuring proper re-enabling of AOF.
- Triggered a save of the cluster configuration file before shutdown to prevent inconsistencies caused by unsaved node configuration changes.
- Fixed timing issue in CLUSTER SETSLOT to ensure replicas handle migration correctly when receiving the command before the gossip update.
- Optimized the handling of temporary set objects in SUNION and SDIFF commands, resulting in a 41% performance improvement for SUNION and 27% for SDIFF.

---
 .../0001-src-Do-not-reset-FINAL_LIBS.patch    |   33 +
 .../valkey/valkey/GNU_SOURCE-7.patch          |   29 +
 .../hiredis-use-default-CC-if-it-is-set.patch |   41 +
 .../valkey/valkey/init-valkey-server          |   71 +
 ...ile-to-use-environment-build-setting.patch |   78 +
 .../valkey/valkey/oe-use-libc-malloc.patch    |   39 +
 .../valkey/valkey/valkey.conf                 | 1314 +++++++++++++++++
 .../valkey/valkey/valkey.service              |   16 +
 .../recipes-extended/valkey/valkey_8.0.0.bb   |   74 +
 9 files changed, 1695 insertions(+)
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/0001-src-Do-not-reset-FINAL_LIBS.patch
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/GNU_SOURCE-7.patch
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/hiredis-use-default-CC-if-it-is-set.patch
 create mode 100755 meta-oe/recipes-extended/valkey/valkey/init-valkey-server
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/lua-update-Makefile-to-use-environment-build-setting.patch
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/oe-use-libc-malloc.patch
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/valkey.conf
 create mode 100644 meta-oe/recipes-extended/valkey/valkey/valkey.service
 create mode 100644 meta-oe/recipes-extended/valkey/valkey_8.0.0.bb
meta-oe/recipes-extended/valkey/valkey/0001-src-Do-not-reset-FINAL_LIBS.patch new file +33 -0
new file mode 100644
index 000000000..ab2265bdb
@@ -0,0 +1,33 @@
+From b4cf6e677cec75a0d2b57dcb2960ad1e16908c82 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 10 Sep 2019 20:04:26 -0700
+Subject: [PATCH] src: Do not reset FINAL_LIBS
+
+This helps case where additional libraries are needed to be passed from
+environment to get it going
+
+e.g. -latomic is needed on clang/x86 to provide for 64bit atomics
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index e0b1d2722..48988e271 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -145,7 +145,7 @@ ifeq ($(SERVER_TEST),yes)
+ 	FINAL_CFLAGS +=-DSERVER_TEST=1
+ endif
+ FINAL_LDFLAGS=$(LDFLAGS) $(OPT) $(SERVER_LDFLAGS) $(DEBUG)
+-FINAL_LIBS=-lm
++FINAL_LIBS+=-lm
+ DEBUG=-g -ggdb
+ 
+ # Linux ARM32 needs -latomic at linking time
+-- 
+2.39.5
+
meta-oe/recipes-extended/valkey/valkey/GNU_SOURCE-7.patch new file +29 -0
new file mode 100644
index 000000000..fa11d058f
@@ -0,0 +1,29 @@
+From f3dd59789e4a8b06777be2725c6c3e36050fd6ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 21 Dec 2019 12:09:51 -0800
+Subject: [PATCH] Define _GNU_SOURCE to get PTHREAD_MUTEX_INITIALIZER
+
+Fixes
+| zmalloc.c:87:37: error: 'PTHREAD_MUTEX_DEFAULT' undeclared here (not in a function)
+|    87 | pthread_mutex_t used_memory_mutex = PTHREAD_MUTEX_INITIALIZER;
+|       |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ src/zmalloc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/zmalloc.c b/src/zmalloc.c
+index 7b19107b6..bd365c11c 100644
+--- a/src/zmalloc.c
++++ b/src/zmalloc.c
+@@ -33,6 +33,7 @@
+ #include "solarisfixes.h"
+ #include "serverassert.h"
+ 
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdint.h>
meta-oe/recipes-extended/valkey/valkey/hiredis-use-default-CC-if-it-is-set.patch new file +41 -0

41 lines not on this page · raw message

meta-oe/recipes-extended/valkey/valkey/init-valkey-server new file +71 -0

71 lines not on this page · raw message

meta-oe/recipes-extended/valkey/valkey/lua-update-Makefile-to-use-environment-build-setting.patch new file +78 -0

78 lines not on this page · raw message

meta-oe/recipes-extended/valkey/valkey/oe-use-libc-malloc.patch new file +39 -0
new file mode 100644
index 000000000..3bab01e3f
@@ -0,0 +1,39 @@
+From ad79a81d6582555e580bdba42c959477e7d35ae7 Mon Sep 17 00:00:00 2001
+From: Venture Research <[email protected]>
+Date: Wed, 6 Feb 2013 20:51:02 -0600
+Subject: [PATCH] hack to force use of libc malloc
+
+Hack to force libc usage as it seems the option to pass it in has been
+removed in favor of magic.
+
+Note that this of course doesn't allow tcmalloc and jemalloc, however
+jemalloc wasn't building correctly.
+
+Signed-off-by: Venture Research <[email protected]>
+
+Update to work with 4.0.8
+Signed-off-by: Alistair Francis <[email protected]>
+
+Update to work with 8.0.0
+Signed-off-by: Leon Anavi <[email protected]>
+
+---
+Upstream-Status: Pending
+
+ src/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 13fa1c027..e0b1d2722 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -13,7 +13,8 @@
+ # Just use 'make dep', but this is only needed by developers.
+ 
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
++# use fake uname option to force use of generic libc
++uname_S := "USE_LIBC_MALLOC"
+ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+ CLANG := $(findstring clang,$(shell sh -c '$(CC) --version | head -1'))
+ 
meta-oe/recipes-extended/valkey/valkey/valkey.conf new file +1314 -0

1,314 lines not on this page · raw message

meta-oe/recipes-extended/valkey/valkey/valkey.service new file +16 -0
new file mode 100644
index 000000000..5c6aa5b17
@@ -0,0 +1,16 @@
+[Unit]
+Description=Valkey: an open source, in-memory data store
+After=network.target
+
+[Service]
+User=valkey
+Group=valkey
+ExecStart=/usr/bin/valkey-server /etc/valkey/valkey.conf
+ExecStop=/usr/bin/valkey-cli shutdown
+Restart=always
+LimitNOFILE=10032
+StateDirectory=valkey
+
+[Install]
+WantedBy=multi-user.target
+
meta-oe/recipes-extended/valkey/valkey_8.0.0.bb new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.39.5