Merge branch 'keydbpro' into keydbpro_collab

Former-commit-id: 446daf8f4c33005096372ad9e29ae9b3d465c64e
This commit is contained in:
John Sully 2021-05-03 22:58:56 +00:00
commit f41b79cea6
84 changed files with 197 additions and 198 deletions

6
.gitignore vendored
View File

@ -10,9 +10,9 @@ core
!**/keydb-sentinel.service.d !**/keydb-sentinel.service.d
*.log *.log
dump.rdb dump.rdb
src/keydb-pro-server src/keydb-server
**/bin/keydb-pro-server **/bin/keydb-server
**/app/keydb-pro-server **/app/keydb-server
*.deb *.deb
*.rpm *.rpm
src/keydb-cli src/keydb-cli

View File

@ -88,9 +88,13 @@ KeyDB can be compiled and is tested for use on Linux. KeyDB currently relies on
More on CentOS/Archlinux/Alpine/Debian/Ubuntu dependencies and builds can be found here: https://docs.keydb.dev/docs/build/ More on CentOS/Archlinux/Alpine/Debian/Ubuntu dependencies and builds can be found here: https://docs.keydb.dev/docs/build/
Init and clone submodule dependencies:
% git submodule init && git submodule update
Install dependencies: Install dependencies:
% sudo apt install build-essential nasm autotools-dev autoconf libjemalloc-dev tcl tcl-dev uuid-dev libcurl4-openssl-dev % sudo apt install build-essential nasm autotools-dev autoconf libjemalloc-dev tcl tcl-dev uuid-dev libcurl4-openssl-dev libbz2-dev libzstd-dev liblz4-dev libsnappy-dev
Compiling is as simple as: Compiling is as simple as:
@ -185,19 +189,19 @@ Running KeyDB
To run KeyDB with the default configuration, just type: To run KeyDB with the default configuration, just type:
% cd src % cd src
% ./keydb-pro-server % ./keydb-server
If you want to provide your keydb.conf, you have to run it using an additional If you want to provide your keydb.conf, you have to run it using an additional
parameter (the path of the configuration file): parameter (the path of the configuration file):
% cd src % cd src
% ./keydb-pro-server /path/to/keydb.conf % ./keydb-server /path/to/keydb.conf
It is possible to alter the KeyDB configuration by passing parameters directly It is possible to alter the KeyDB configuration by passing parameters directly
as options using the command line. Examples: as options using the command line. Examples:
% ./keydb-pro-server --port 9999 --replicaof 127.0.0.1 6379 % ./keydb-server --port 9999 --replicaof 127.0.0.1 6379
% ./keydb-pro-server /etc/keydb/6379.conf --loglevel debug % ./keydb-server /etc/keydb/6379.conf --loglevel debug
All the options in keydb.conf are also supported as options using the command All the options in keydb.conf are also supported as options using the command
line, with exactly the same name. line, with exactly the same name.
@ -213,7 +217,7 @@ how to use Redis with TLS.
Playing with KeyDB Playing with KeyDB
------------------ ------------------
You can use keydb-cli to play with KeyDB. Start a keydb-pro-server instance, You can use keydb-cli to play with KeyDB. Start a keydb-server instance,
then in another terminal try the following: then in another terminal try the following:
% cd src % cd src
@ -278,7 +282,7 @@ Simply make a directory you would like to have the latest binaries dumped in, th
``` ```
$ docker run -it --rm -v /path-to-dump-binaries:/keydb_bin eqalpha/keydb-build-bin $ docker run -it --rm -v /path-to-dump-binaries:/keydb_bin eqalpha/keydb-build-bin
``` ```
You should receive the following files: keydb-benchmark, keydb-check-aof, keydb-check-rdb, keydb-cli, keydb-sentinel, keydb-pro-server You should receive the following files: keydb-benchmark, keydb-check-aof, keydb-check-rdb, keydb-cli, keydb-sentinel, keydb-server
If you are looking to enable flash support with the build (make MALLOC=memkind) then use the following command: If you are looking to enable flash support with the build (make MALLOC=memkind) then use the following command:
``` ```

View File

@ -29,9 +29,9 @@ INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(INCLUDE_PATH)
INSTALL_LIBRARY_PATH= $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH) INSTALL_LIBRARY_PATH= $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
INSTALL_PKGCONF_PATH= $(INSTALL_LIBRARY_PATH)/$(PKGCONF_PATH) INSTALL_PKGCONF_PATH= $(INSTALL_LIBRARY_PATH)/$(PKGCONF_PATH)
# keydb-pro-server configuration used for testing # keydb-server configuration used for testing
REDIS_PORT=56379 REDIS_PORT=56379
REDIS_SERVER=keydb-pro-server REDIS_SERVER=keydb-server
define REDIS_TEST_CONFIG define REDIS_TEST_CONFIG
daemonize yes daemonize yes
pidfile /tmp/hiredis-test-redis.pid pidfile /tmp/hiredis-test-redis.pid

View File

@ -3,7 +3,7 @@
# Note that in order to read the configuration file, KeyDB must be # Note that in order to read the configuration file, KeyDB must be
# started with the file path as first argument: # started with the file path as first argument:
# #
# ./keydb-pro-server /path/to/keydb.conf # ./keydb-server /path/to/keydb.conf
# Note on units: when memory size is needed, it is possible to specify # Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth: # it in the usual form of 1k 5GB 4M and so forth:
@ -1828,9 +1828,9 @@ server-threads 2
# bringing up replicas can result in data loss (the first master will win). # bringing up replicas can result in data loss (the first master will win).
# active-replica yes # active-replica yes
# Enable Pro? KeyDB pro provides support for pro only features # Enable Enterprise? KeyDB Enterprise provides support for Enterprise only features
# note: you may omit the license key to demo pro features for a limited time # note: you may omit the license key to demo Enterprise features for a limited time
# enable-pro [License Key] # enable-enterprise [License Key]
# Enable FLASH support? (Pro Only) # Enable FLASH support? (Enterprise Only)
# storage-provider flash /path/to/flash/db # storage-provider flash /path/to/flash/db

View File

@ -1568,9 +1568,9 @@ server-threads 2
# bringing up replicas can result in data loss (the first master will win). # bringing up replicas can result in data loss (the first master will win).
# active-replica yes # active-replica yes
# Enable Pro? KeyDB pro provides support for pro only features # Enable Enterprise? KeyDB Enterprise provides support for Enterprise only features
# note: you may omit the license key to demo pro features for a limited time # note: you may omit the license key to demo Enterprise features for a limited time
# enable-pro [License Key] # enable-enterprise [License Key]
# Enable FLASH support? (Pro Only) # Enable FLASH support? (Enterprise Only)
# storage-provider flash /path/to/flash/db # storage-provider flash /path/to/flash/db

View File

@ -19,11 +19,11 @@ elif [ "$distributor" == "Ubuntu" ]; then
fi fi
codename=$(lsb_release --codename --short) codename=$(lsb_release --codename --short)
date=$(date +%a," "%d" "%b" "%Y" "%T) date=$(date +%a," "%d" "%b" "%Y" "%T)
pkg_name=keydb-pro-$majorv:$version$distname pkg_name=keydb-enterprise-$majorv:$version$distname
# create build tree # create build tree
cd ../../../ cd ../../../
tar -czvf keydb-pro_$version.orig.tar.gz --force-local KeyDB-Pro tar -czvf keydb-enterprise_$version.orig.tar.gz --force-local KeyDB-Pro
cd KeyDB-Pro/pkg/deb/ cd KeyDB-Pro/pkg/deb/
mkdir -p $pkg_name/tmp mkdir -p $pkg_name/tmp
if [[ "$codename" == "xenial" ]] || [[ "$codename" == "stretch" ]]; then if [[ "$codename" == "xenial" ]] || [[ "$codename" == "stretch" ]]; then
@ -32,9 +32,9 @@ else
cp -r debian $pkg_name/tmp cp -r debian $pkg_name/tmp
fi fi
cp master_changelog $pkg_name/tmp/debian/changelog cp master_changelog $pkg_name/tmp/debian/changelog
mv ../../../keydb-pro_$version.orig.tar.gz ./$pkg_name mv ../../../keydb-enterprise_$version.orig.tar.gz ./$pkg_name
cd $pkg_name/tmp cd $pkg_name/tmp
changelog_str="keydb-pro ($majorv:$version-$build$distname) $codename; urgency=medium\n\n * $version $changelog_comments \n\n -- Ben Schermel <ben@eqalpha.com> $date +0000\n\n" changelog_str="keydb-enterprise ($majorv:$version-$build$distname) $codename; urgency=medium\n\n * $version $changelog_comments \n\n -- Ben Schermel <ben@eqalpha.com> $date +0000\n\n"
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
sed -i "1s/^/$changelog_str\n/" debian/changelog sed -i "1s/^/$changelog_str\n/" debian/changelog
elif [ $# -eq 1 ] && [ "$1" != "None" ]; then elif [ $# -eq 1 ] && [ "$1" != "None" ]; then

View File

@ -25,28 +25,22 @@ do
case "${BINARY}" in case "${BINARY}" in
keydb-server) keydb-server)
NAME="keydb" NAME="keydb"
BINARY_EXEC="keydb-server"
BINARY_NAME="keydb-pro-server"
TARGET_NAME="keydb-pro-server"
;; ;;
keydb-sentinel) keydb-sentinel)
NAME="sentinel" NAME="sentinel"
BINARY_EXEC="keydb-sentinel"
BINARY_NAME="keydb-sentinel"
TARGET_NAME="keydb-pro-sentinel"
;; ;;
esac esac
case "${MODE}" in case "${MODE}" in
default) default)
EXTRA="Alias=${NAME}.service" EXTRA="Alias=${NAME}.service"
TARGET="debian/${TARGET_NAME}.${BINARY}.service" TARGET="debian/${BINARY}.service"
NAMESPACED="${NAME}" NAMESPACED="${NAME}"
DESCRIPTION="Advanced key-value store" DESCRIPTION="Advanced key-value store"
;; ;;
templated) templated)
EXTRA="" EXTRA=""
TARGET="debian/${TARGET_NAME}.${BINARY}@.service" TARGET="debian/${BINARY}@.service"
NAMESPACED="${NAME}-%i" NAMESPACED="${NAME}-%i"
DESCRIPTION="Advanced key-value store (%I)" DESCRIPTION="Advanced key-value store (%I)"
;; ;;
@ -94,7 +88,7 @@ Documentation=https://docs.keydb.dev, man:${BINARY}(1)
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/${BINARY_NAME} /etc/keydb/${NAMESPACED}.conf ExecStart=/usr/bin/${BINARY} /etc/keydb/${NAMESPACED}.conf
ExecStop=/bin/kill -s TERM \$MAINPID ExecStop=/bin/kill -s TERM \$MAINPID
PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid
TimeoutStopSec=0 TimeoutStopSec=0

View File

@ -1,4 +1,4 @@
Source: keydb-pro Source: keydb-enterprise
Section: database Section: database
Priority: optional Priority: optional
Maintainer: Ben Schermel <ben@eqalpha.com> Maintainer: Ben Schermel <ben@eqalpha.com>
@ -7,6 +7,7 @@ Build-Depends:
dpkg-dev (>= 1.17.5), dpkg-dev (>= 1.17.5),
systemd, systemd,
procps <!nocheck>, procps <!nocheck>,
pkg-config <!nocheck>,
build-essential <!nocheck>, build-essential <!nocheck>,
tcl <!nocheck>, tcl <!nocheck>,
tcl-dev <!nocheck>, tcl-dev <!nocheck>,
@ -24,14 +25,14 @@ Build-Depends:
libzstd-dev <!nocheck> libzstd-dev <!nocheck>
Standards-Version: 4.2.1 Standards-Version: 4.2.1
Homepage: https://docs.keydb.dev/ Homepage: https://docs.keydb.dev/
Vcs-Git: https://github.com/JohnSully/KeyDB-Pro.git Vcs-Git: https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro.git
Vcs-Browser: https://github.com/JohnSully/KeyDB-Pro Vcs-Browser: https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro
Package: keydb-pro Package: keydb-enterprise
Architecture: all Architecture: all
Depends: Depends:
keydb-pro-server (<< ${binary:Version}.1~), keydb-enterprise-server (<< ${binary:Version}.1~),
keydb-pro-server (>= ${binary:Version}), keydb-enterprise-server (>= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface (metapackage) Description: Persistent key-value database with network interface (metapackage)
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -42,11 +43,11 @@ Description: Persistent key-value database with network interface (metapackage)
. .
This package depends on the keydb-server package. This package depends on the keydb-server package.
Package: keydb-pro-sentinel Package: keydb-enterprise-sentinel
Architecture: any Architecture: any
Depends: Depends:
lsb-base (>= 3.2-14), lsb-base (>= 3.2-14),
keydb-pro-tools (= ${binary:Version}), keydb-enterprise-tools (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface (monitoring) Description: Persistent key-value database with network interface (monitoring)
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -55,11 +56,11 @@ Description: Persistent key-value database with network interface (monitoring)
. .
This package contains the keydb Sentinel monitoring software. This package contains the keydb Sentinel monitoring software.
Package: keydb-pro-server Package: keydb-enterprise-server
Architecture: any Architecture: any
Depends: Depends:
lsb-base (>= 3.2-14), lsb-base (>= 3.2-14),
keydb-pro-tools (= ${binary:Version}), keydb-enterprise-tools (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface Description: Persistent key-value database with network interface
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -68,7 +69,7 @@ Description: Persistent key-value database with network interface
. .
The dataset is stored entirely in memory and periodically flushed to disk. The dataset is stored entirely in memory and periodically flushed to disk.
Package: keydb-pro-tools Package: keydb-enterprise-tools
Architecture: any Architecture: any
Depends: Depends:
adduser, adduser,

View File

@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Contact: John Sully <john@eqalpha.com> Upstream-Contact: John Sully <john@eqalpha.com>
Upstream-Name: keydb-pro Upstream-Name: keydb-enterprise
Source: https://github.com/JohnSully/KeyDB-Pro Source: https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro
Files: * Files: *
Copyright: © 2006-2014 Salvatore Sanfilippo <antirez@gmail.com> Copyright: © 2006-2014 Salvatore Sanfilippo <antirez@gmail.com>

View File

@ -0,0 +1 @@
debian/keydb-enterprise-sentinel.1

View File

@ -0,0 +1 @@
debian/keydb-enterprise-server.1

View File

@ -3,5 +3,5 @@ src/keydb-benchmark /usr/bin
src/keydb-check-aof /usr/bin src/keydb-check-aof /usr/bin
src/keydb-check-rdb /usr/bin src/keydb-check-rdb /usr/bin
src/keydb-cli /usr/bin src/keydb-cli /usr/bin
src/keydb-pro-server /usr/bin src/keydb-server /usr/bin
src/keydb-sentinel /usr/bin src/keydb-sentinel /usr/bin

View File

@ -1 +0,0 @@
debian/keydb-pro-sentinel.1

View File

@ -1 +0,0 @@
debian/keydb-pro-server.1

View File

@ -1,2 +1,2 @@
# Upstream do not provide signed tarballs. # Upstream do not provide signed tarballs.
keydb-pro source: debian-watch-does-not-check-gpg-signature keydb-enterprise source: debian-watch-does-not-check-gpg-signature

View File

@ -1,3 +1,3 @@
version=6 version=6
opts=uversionmangle=s/-?(alpha|beta|rc)/~$1/ \ opts=uversionmangle=s/-?(alpha|beta|rc)/~$1/ \
https://github.com/JohnSully/KeyDB-Pro/releases .*/archive/(.*).tar.gz https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro/releases .*/archive/(.*).tar.gz

View File

@ -25,13 +25,9 @@ do
case "${BINARY}" in case "${BINARY}" in
keydb-server) keydb-server)
NAME="keydb" NAME="keydb"
BINARY_EXEC="keydb-server"
BINARY_NAME="keydb-pro-server"
;; ;;
keydb-sentinel) keydb-sentinel)
NAME="sentinel" NAME="sentinel"
BINARY_EXEC="keydb-sentinel"
BINARY_NAME="keydb-sentinel"
;; ;;
esac esac
@ -92,7 +88,7 @@ Documentation=https://docs.keydb.dev, man:${BINARY}(1)
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/${BINARY_NAME} /etc/keydb/${NAMESPACED}.conf ExecStart=/usr/bin/${BINARY} /etc/keydb/${NAMESPACED}.conf
ExecStop=/bin/kill -s TERM \$MAINPID ExecStop=/bin/kill -s TERM \$MAINPID
PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid
TimeoutStopSec=0 TimeoutStopSec=0

View File

@ -1,4 +1,4 @@
Source: keydb-pro Source: keydb-enterprise
Section: database Section: database
Priority: optional Priority: optional
Maintainer: Ben Schermel <ben@eqalpha.com> Maintainer: Ben Schermel <ben@eqalpha.com>
@ -29,14 +29,14 @@ Build-Depends:
libzstd-dev <!nocheck> libzstd-dev <!nocheck>
Standards-Version: 4.2.1 Standards-Version: 4.2.1
Homepage: https://docs.keydb.dev/ Homepage: https://docs.keydb.dev/
Vcs-Git: https://github.com/JohnSully/KeyDB-Pro.git Vcs-Git: https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro.git
Vcs-Browser: https://github.com/JohnSully/KeyDB-Pro Vcs-Browser: https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro
Package: keydb-pro Package: keydb-enterprise
Architecture: all Architecture: all
Depends: Depends:
keydb-pro-server (<< ${binary:Version}.1~), keydb-enterprise-server (<< ${binary:Version}.1~),
keydb-pro-server (>= ${binary:Version}), keydb-enterprise-server (>= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface (metapackage) Description: Persistent key-value database with network interface (metapackage)
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -47,11 +47,11 @@ Description: Persistent key-value database with network interface (metapackage)
. .
This package depends on the keydb-server package. This package depends on the keydb-server package.
Package: keydb-pro-sentinel Package: keydb-enterprise-sentinel
Architecture: any Architecture: any
Depends: Depends:
lsb-base (>= 3.2-14), lsb-base (>= 3.2-14),
keydb-pro-tools (= ${binary:Version}), keydb-enterprise-tools (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface (monitoring) Description: Persistent key-value database with network interface (monitoring)
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -60,11 +60,11 @@ Description: Persistent key-value database with network interface (monitoring)
. .
This package contains the keydb Sentinel monitoring software. This package contains the keydb Sentinel monitoring software.
Package: keydb-pro-server Package: keydb-enterprise-server
Architecture: any Architecture: any
Depends: Depends:
lsb-base (>= 3.2-14), lsb-base (>= 3.2-14),
keydb-pro-tools (= ${binary:Version}), keydb-enterprise-tools (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface Description: Persistent key-value database with network interface
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -73,7 +73,7 @@ Description: Persistent key-value database with network interface
. .
The dataset is stored entirely in memory and periodically flushed to disk. The dataset is stored entirely in memory and periodically flushed to disk.
Package: keydb-pro-tools Package: keydb-enterprise-tools
Architecture: any Architecture: any
Depends: Depends:
adduser, adduser,

View File

@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Contact: John Sully <john@eqalpha.com> Upstream-Contact: John Sully <john@eqalpha.com>
Upstream-Name: keydb-pro Upstream-Name: keydb-enterprise
Source: https://github.com/JohnSully/KeyDB-Pro Source: https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro
Files: * Files: *
Copyright: © 2006-2014 Salvatore Sanfilippo <antirez@gmail.com> Copyright: © 2006-2014 Salvatore Sanfilippo <antirez@gmail.com>

View File

@ -1 +0,0 @@
keydb-pro_5.3.3-1~bionic1_source.buildinfo database optional

View File

@ -0,0 +1 @@
debian/keydb-enterprise-sentinel.1

View File

@ -0,0 +1 @@
debian/keydb-enterprise-server.1

View File

@ -3,5 +3,5 @@ src/keydb-benchmark /usr/bin
src/keydb-check-aof /usr/bin src/keydb-check-aof /usr/bin
src/keydb-check-rdb /usr/bin src/keydb-check-rdb /usr/bin
src/keydb-cli /usr/bin src/keydb-cli /usr/bin
src/keydb-pro-server /usr/bin src/keydb-server /usr/bin
src/keydb-sentinel /usr/bin src/keydb-sentinel /usr/bin

View File

@ -1 +0,0 @@
debian/keydb-pro-sentinel.1

View File

@ -1 +0,0 @@
debian/keydb-pro-server.1

View File

@ -1,3 +1,3 @@
keydb-pro_5.0.6.orig.tar.gz keydb-enterprise_5.0.6.orig.tar.gz
keydb-pro_5.0.6-1~bionic1.debian.tar.xz keydb-enterprise_5.0.6-1~bionic1.debian.tar.xz

View File

@ -1,2 +1,2 @@
# Upstream do not provide signed tarballs. # Upstream do not provide signed tarballs.
keydb-pro source: debian-watch-does-not-check-gpg-signature keydb-enterprise source: debian-watch-does-not-check-gpg-signature

View File

@ -1,3 +1,3 @@
version=6 version=6
opts=uversionmangle=s/-?(alpha|beta|rc)/~$1/ \ opts=uversionmangle=s/-?(alpha|beta|rc)/~$1/ \
https://github.com/JohnSully/KeyDB-Pro/releases .*/archive/(.*).tar.gz https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro/releases .*/archive/(.*).tar.gz

View File

@ -1,58 +1,5 @@
keydb-pro (6:6.0.12-1distribution_placeholder) codename_placeholder; urgency=medium keydb-enterprise (6:6.0.12-1distribution_placeholder) codename_placeholder; urgency=medium
* 6.0.12 Enable SCAN for MVCC * 6.0.12 Enable SCAN for MVCC
-- Ben Schermel <ben@eqalpha.com> Fri, 10 Jul 2020 20:00:37 +0000 -- Ben Schermel <ben@eqalpha.com> Fri, 10 Jul 2020 20:00:37 +0000
keydb-pro (6:6.0.11-1distribution_placeholder) codename_placeholder; urgency=medium
* 6.0.11 fixes applied related to cluster usage and expires
-- Ben Schermel <ben@eqalpha.com> Wed, 17 Jun 2020 20:00:37 +0000
keydb-pro (6:6.0.9-1distribution_placeholder) codename_placeholder; urgency=medium
* 6.0.9 Addressing issues 187 - cpu lockup with subkey expire, 190 - missing sentinel binary in keydb-tools.
* FLASH performance updates, including updating client handling to mitigate SSD overload behavior on heavy writes.
* flash_memory parameter has been added to INFO memory
-- Ben Schermel <ben@eqalpha.com> Sun, 07 Jun 2020 18:00:37 +0000
keydb-pro (6:6.0.8-1distribution_placeholder) codename_placeholder; urgency=medium
* This is our first release to fully support all Redis 6.0.4 features, including but not limited to: TLS Support (fully supports multithreading!), Client side caching, RESP 3 Support
* KeyDB Has also added the following new features: Improved memory efficiency for short strings, Fastlock autotuning, KeyDB.HRENAME (rename a member of a hash)In addition we've spent a lot of time focussing on stability.
* The following bug fixes are resolved: #150 - Deadlock in ReplicationFeedMonitors, #170 - KeyDB dying via SIGABORT, #180 - crash after setting maxclients via cmd line, #169 - Write performance of a master dropped sharply when a slave is added
* In addition untracked issues were resolved: Potential deadlock when entering futex sleep, Pub/Sub Async messages may not be sent in a timely manner when load is low, Excessive logging during failed RREPLAY, KeyDB unresponsive handling clients on different threads during RDB load
* Updated deb package builds to build from source and phasing out init.d. dh_installsystemd from deb helper 11 used where applicable
* Naming conventions are now updated [ keydbpackage_version-build~distribution_architecture] and master changelog included and maintained
* keydb-pro-server binary is no longer inluded in the open source package
-- Ben Schermel <ben@eqalpha.com> Mon, 1 Jun 2020 8:00:37 +0000
keydb-pro (5:5.1.12-1chl1distribution_placeholder) codename_placeholder; urgency=medium
* 5.1.1 update. This update fixes several rare deadlock scenarios. Deadlock detection is also added.
-- Ben Schermel <ben@eqalpha.com> Fri, 25 Oct 2019 8:00:37 +0000
keydb-pro (5:5.1.11-1chl1distribution_placeholder) codename_placeholder; urgency=medium
* 5.1 release. This release includes subkey expires (EXPIREMEMBER/EXPIREMEMBERAT), with updates to PTTL/TTL accordingly. New OBJECT LASTMODIFIED, BITIOP LSHIFT & BITOP RSHIFT commands. See https://docs.keydb.dev/blog/2019/10/20/blog-post/ for detailed review of release.
-- Ben Schermel <ben@eqalpha.com> Mon, 21 Oct 2019 8:00:37 +0000
keydb-pro (5:5.0.1-1chl1distribution_placeholder) codename_placeholder; urgency=medium
* Arm build now included for bionic package
-- Ben Schermel <ben@eqalpha.com> Wed, 21 Aug 2019 22:58:37 +0000
keydb-pro (5:5.0.0-1chl1distribution_placeholder) codename_placeholder; urgency=medium
* Initial release of KeyDB PPA. This PPA was originally derived from https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
-- Ben Schermel <ben@eqalpha.com> Wed, 21 Aug 2019 2:58:37 +0000

View File

@ -88,4 +88,4 @@ ENTRYPOINT ["docker-entrypoint.sh"]
# Expose container port and start KeyDB by default on running container # Expose container port and start KeyDB by default on running container
EXPOSE 6379 EXPOSE 6379
CMD ["keydb-pro-server", "/etc/keydb/keydb.conf"] CMD ["keydb-server", "/etc/keydb/keydb.conf"]

View File

@ -6,6 +6,9 @@ version=$(grep KEYDB_REAL_VERSION $DIR/../../src/version.h | awk '{ printf $3 }'
release=1 # by default this will always be 1 for keydb version structure. If build release version needs to be update you can modify here release=1 # by default this will always be 1 for keydb version structure. If build release version needs to be update you can modify here
arch=$(uname -m) arch=$(uname -m)
dist=el$(rpm -q --queryformat '%{VERSION}' centos-release | cut -d. -f1) dist=el$(rpm -q --queryformat '%{VERSION}' centos-release | cut -d. -f1)
if [[ "$dist" == "elpackage centos-release is not installed" ]]; then
dist=el$(rpm -q --queryformat '%{VERSION}' centos-linux-release | cut -d. -f1)
fi
if [[ "$arch" != "aarch64" ]] && [[ "$arch" != "x86_64" ]]; then if [[ "$arch" != "aarch64" ]] && [[ "$arch" != "x86_64" ]]; then
echo "This script is only valid and tested for aarch64 and x86_64 architectures. You are trying to use: $arch" echo "This script is only valid and tested for aarch64 and x86_64 architectures. You are trying to use: $arch"
@ -31,8 +34,8 @@ sed -i '3d' $DIR/keydb_build/keydb.spec
sed -i -E "2a\Release : $release%{?dist}" $DIR/keydb_build/keydb.spec sed -i -E "2a\Release : $release%{?dist}" $DIR/keydb_build/keydb.spec
# yum install -y scl-utils centos-release-scl rpm-build # yum install -y scl-utils centos-release-scl rpm-build
mkdir -p /root/rpmbuild/BUILDROOT/keydb-pro-$version-$release.$dist.$arch mkdir -p /root/rpmbuild/BUILDROOT/keydb-enterprise-$version-$release.$dist.$arch
cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-pro-$version-$release.$dist.$arch/ cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-enterprise-$version-$release.$dist.$arch/
rpmbuild -bb $DIR/keydb_build/keydb.spec rpmbuild -bb $DIR/keydb_build/keydb.spec
mv /root/rpmbuild/RPMS/$arch/* $DIR/rpm_files_generated mv /root/rpmbuild/RPMS/$arch/* $DIR/rpm_files_generated

View File

@ -1,4 +1,4 @@
Name : keydb-pro Name : keydb-enterprise
Version : 6.0.5 Version : 6.0.5
Release : 1%{?dist} Release : 1%{?dist}
Group : Unspecified Group : Unspecified
@ -27,7 +27,7 @@ getent group keydb &> /dev/null || \
groupadd -r keydb &> /dev/null groupadd -r keydb &> /dev/null
getent passwd keydb &> /dev/null || \ getent passwd keydb &> /dev/null || \
useradd -r -g keydb -d /var/lib/keydb -s /sbin/nologin \ useradd -r -g keydb -d /var/lib/keydb -s /sbin/nologin \
-c 'KeyDB Professional Database Server' keydb &> /dev/null -c 'KeyDB Enterprise Database Server' keydb &> /dev/null
exit 0 exit 0
#postinstall scriptlet (using /bin/sh): #postinstall scriptlet (using /bin/sh):

View File

@ -1568,9 +1568,9 @@ server-threads 2
# bringing up replicas can result in data loss (the first master will win). # bringing up replicas can result in data loss (the first master will win).
# active-replica yes # active-replica yes
# Enable Pro? KeyDB pro provides support for pro only features # Enable Enterprise? KeyDB Enterprise provides support for Enterprise only features
# note: you may omit the license key to demo pro features for a limited time # note: you may omit the license key to demo Enterprise features for a limited time
# enable-pro [License Key] # enable-enterprise [License Key]
# Enable FLASH support? (Pro Only) # Enable FLASH support? (Enterprise Only)
# storage-provider flash /path/to/flash/db # storage-provider flash /path/to/flash/db

View File

@ -5,7 +5,7 @@ Documentation=https://docs.keydb.dev, man:keydb-server(1)
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/keydb-pro-server /etc/keydb/keydb.conf ExecStart=/usr/bin/keydb-server /etc/keydb/keydb.conf
ExecStop=/bin/kill -s TERM $MAINPID ExecStop=/bin/kill -s TERM $MAINPID
PIDFile=/var/run/keydb/keydb-server.pid PIDFile=/var/run/keydb/keydb-server.pid
TimeoutStopSec=0 TimeoutStopSec=0

View File

@ -310,7 +310,7 @@ QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(EN
QUIET_INSTALL = @printf ' %b %b\n' $(LINKCOLOR)INSTALL$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR); QUIET_INSTALL = @printf ' %b %b\n' $(LINKCOLOR)INSTALL$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR);
endif endif
REDIS_SERVER_NAME=keydb-pro-server$(PROG_SUFFIX) REDIS_SERVER_NAME=keydb-server$(PROG_SUFFIX)
REDIS_SENTINEL_NAME=keydb-sentinel$(PROG_SUFFIX) REDIS_SENTINEL_NAME=keydb-sentinel$(PROG_SUFFIX)
REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o t_nhash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o acl.o storage.o rdb-s3.o fastlock.o new.o tracking.o cron.o connection.o tls.o sha256.o motd.o timeout.o setcpuaffinity.o AsyncWorkQueue.o snapshot.o storage/rocksdb.o storage/rocksdbfactory.o storage/teststorageprovider.o keydbutils.o StorageCache.o $(ASM_OBJ) REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o t_nhash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o acl.o storage.o rdb-s3.o fastlock.o new.o tracking.o cron.o connection.o tls.o sha256.o motd.o timeout.o setcpuaffinity.o AsyncWorkQueue.o snapshot.o storage/rocksdb.o storage/rocksdbfactory.o storage/teststorageprovider.o keydbutils.o StorageCache.o $(ASM_OBJ)
REDIS_CLI_NAME=keydb-cli$(PROG_SUFFIX) REDIS_CLI_NAME=keydb-cli$(PROG_SUFFIX)
@ -368,7 +368,7 @@ else
endif endif
@touch $@ @touch $@
# keydb-pro-server # keydb-server
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ) $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
$(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/rocksdb/librocksdb.a $(FINAL_LIBS) $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/rocksdb/librocksdb.a $(FINAL_LIBS)

View File

@ -32,7 +32,7 @@ const char *ascii_logo =
" _ \n" " _ \n"
" _-(+)-_ \n" " _-(+)-_ \n"
" _-- / \\ --_ \n" " _-- / \\ --_ \n"
" _-- / \\ --_ KeyDB Pro %s (%s/%d) %s bit \n" " _-- / \\ --_ KeyDB Enterprise %s (%s/%d) %s bit \n"
" __-- / \\ --__ \n" " __-- / \\ --__ \n"
" (+) _ / \\ _ (+) Running in %s mode\n" " (+) _ / \\ _ (+) Running in %s mode\n"
" | -- / \\ -- | Port: %d\n" " | -- / \\ -- | Port: %d\n"

View File

@ -730,7 +730,7 @@ void loadServerConfigFromString(char *config) {
g_sdsProvider = sdsdup(argv[1]); g_sdsProvider = sdsdup(argv[1]);
if (argc > 2) if (argc > 2)
g_sdsArgs = sdsdup(argv[2]); g_sdsArgs = sdsdup(argv[2]);
} else if (!strcasecmp(argv[0],"enable-pro") && (argc == 1 || argc == 2)) { } else if (!strcasecmp(argv[0],"enable-enterprise") && (argc == 1 || argc == 2)) {
if (argc == 2) if (argc == 2)
{ {
if (!FValidKey(argv[1], strlen(argv[1]))) { if (!FValidKey(argv[1], strlen(argv[1]))) {
@ -1855,7 +1855,7 @@ int rewriteConfig(char *path, int force_all) {
rewriteConfigClientoutputbufferlimitOption(state); rewriteConfigClientoutputbufferlimitOption(state);
rewriteConfigYesNoOption(state,"active-replica",g_pserver->fActiveReplica,CONFIG_DEFAULT_ACTIVE_REPLICA); rewriteConfigYesNoOption(state,"active-replica",g_pserver->fActiveReplica,CONFIG_DEFAULT_ACTIVE_REPLICA);
rewriteConfigStringOption(state, "version-override",KEYDB_SET_VERSION,KEYDB_REAL_VERSION); rewriteConfigStringOption(state, "version-override",KEYDB_SET_VERSION,KEYDB_REAL_VERSION);
rewriteConfigStringOption(state, "enable-pro", cserver.license_key, CONFIG_DEFAULT_LICENSE_KEY); rewriteConfigStringOption(state, "enable-enterprise", cserver.license_key, CONFIG_DEFAULT_LICENSE_KEY);
rewriteConfigOOMScoreAdjValuesOption(state); rewriteConfigOOMScoreAdjValuesOption(state);
/* Rewrite Sentinel config if in Sentinel mode. */ /* Rewrite Sentinel config if in Sentinel mode. */

View File

@ -1817,7 +1817,7 @@ void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
"\n=== KEYDB BUG REPORT END. Make sure to include from START to END. ===\n\n" "\n=== KEYDB BUG REPORT END. Make sure to include from START to END. ===\n\n"
" Please report the crash by opening an issue on github:\n\n" " Please report the crash by opening an issue on github:\n\n"
" https://github.com/JohnSully/KeyDB/issues\n\n" " https://github.com/JohnSully/KeyDB/issues\n\n"
" Suspect RAM error? Use keydb-pro-server --test-memory to verify it.\n\n" " Suspect RAM error? Use keydb-server --test-memory to verify it.\n\n"
); );
/* free(messages); Don't call free() with possibly corrupted memory. */ /* free(messages); Don't call free() with possibly corrupted memory. */

View File

@ -158,6 +158,7 @@ client *createClient(connection *conn, int iel) {
c->reploff_cmd = 0; c->reploff_cmd = 0;
c->repl_ack_off = 0; c->repl_ack_off = 0;
c->repl_ack_time = 0; c->repl_ack_time = 0;
c->repl_down_since = 0;
c->slave_listening_port = 0; c->slave_listening_port = 0;
c->slave_ip[0] = '\0'; c->slave_ip[0] = '\0';
c->slave_capa = SLAVE_CAPA_NONE; c->slave_capa = SLAVE_CAPA_NONE;
@ -1619,6 +1620,7 @@ void freeClientAsync(client *c) {
lock.arm(c); lock.arm(c);
if (c->flags & CLIENT_CLOSE_ASAP || c->flags & CLIENT_LUA) return; // race condition after we acquire the lock if (c->flags & CLIENT_CLOSE_ASAP || c->flags & CLIENT_LUA) return; // race condition after we acquire the lock
c->flags |= CLIENT_CLOSE_ASAP; c->flags |= CLIENT_CLOSE_ASAP;
c->repl_down_since = g_pserver->unixtime;
std::unique_lock<fastlock> ul(lockasyncfree); std::unique_lock<fastlock> ul(lockasyncfree);
listAddNodeTail(g_pserver->clients_to_close,c); listAddNodeTail(g_pserver->clients_to_close,c);
} }
@ -2372,7 +2374,7 @@ void parseClientCommandBuffer(client *c) {
/* Prefetch outside the lock for better perf */ /* Prefetch outside the lock for better perf */
if (g_pserver->prefetch_enabled && cqueriesStart < c->vecqueuedcmd.size() && if (g_pserver->prefetch_enabled && cqueriesStart < c->vecqueuedcmd.size() &&
(g_pserver->m_pstorageFactory || aeLockContested(cserver.cthreads/2)) && !GlobalLocksAcquired()) { (g_pserver->m_pstorageFactory || aeLockContested(cserver.cthreads/2) || cserver.cthreads == 1) && !GlobalLocksAcquired()) {
auto &query = c->vecqueuedcmd.back(); auto &query = c->vecqueuedcmd.back();
if (query.argc > 0 && query.argc == query.argcMax) { if (query.argc > 0 && query.argc == query.argcMax) {
if (c->db->prefetchKeysAsync(c, query, c->vecqueuedcmd.size() == 1)) { if (c->db->prefetchKeysAsync(c, query, c->vecqueuedcmd.size() == 1)) {
@ -2408,6 +2410,7 @@ void processInputBuffer(client *c, bool fParse, int callFlags) {
/* Return if we're still parsing this command */ /* Return if we're still parsing this command */
auto &cmd = c->vecqueuedcmd.front(); auto &cmd = c->vecqueuedcmd.front();
if (cmd.argc != cmd.argcMax) break; if (cmd.argc != cmd.argcMax) break;
if (c->flags & CLIENT_EXECUTING_COMMAND) break;
if (!FClientReady(c)) break; if (!FClientReady(c)) break;
@ -2426,13 +2429,16 @@ void processInputBuffer(client *c, bool fParse, int callFlags) {
if (c->argc == 0) { if (c->argc == 0) {
resetClient(c); resetClient(c);
} else { } else {
c->flags |= CLIENT_EXECUTING_COMMAND;
/* We are finally ready to execute the command. */ /* We are finally ready to execute the command. */
if (processCommandAndResetClient(c, callFlags) == C_ERR) { if (processCommandAndResetClient(c, callFlags) == C_ERR) {
/* If the client is no longer valid, we avoid exiting this /* If the client is no longer valid, we avoid exiting this
* loop and trimming the client buffer later. So we return * loop and trimming the client buffer later. So we return
* ASAP in that case. */ * ASAP in that case. */
c->flags &= ~CLIENT_EXECUTING_COMMAND;
return; return;
} }
c->flags &= ~CLIENT_EXECUTING_COMMAND;
} }
} }
} }

View File

@ -2748,8 +2748,8 @@ void syncWithMaster(connection *conn) {
err = sendSynchronousCommand(mi, SYNC_CMD_READ,conn,NULL); err = sendSynchronousCommand(mi, SYNC_CMD_READ,conn,NULL);
if (err[0] == '-') { if (err[0] == '-') {
if (err[1] == 'E' && err[2] == 'R' && err[3] == 'R') { if (err[1] == 'E' && err[2] == 'R' && err[3] == 'R') {
// Replicating with non-pro // Replicating with non-enterprise
serverLog(LL_WARNING, "Replicating with non-pro server."); serverLog(LL_WARNING, "Replicating with non-enterprise server.");
} else { } else {
serverLog(LL_WARNING, "Recieved error from client: %s", err); serverLog(LL_WARNING, "Recieved error from client: %s", err);
sdsfree(err); sdsfree(err);
@ -3214,9 +3214,14 @@ void replicationHandleMasterDisconnection(redisMaster *mi) {
moduleFireServerEvent(REDISMODULE_EVENT_MASTER_LINK_CHANGE, moduleFireServerEvent(REDISMODULE_EVENT_MASTER_LINK_CHANGE,
REDISMODULE_SUBEVENT_MASTER_LINK_DOWN, REDISMODULE_SUBEVENT_MASTER_LINK_DOWN,
NULL); NULL);
if (mi->master && mi->master->repl_down_since) {
mi->repl_down_since = mi->master->repl_down_since;
}
else {
mi->repl_down_since = g_pserver->unixtime;
}
mi->master = NULL; mi->master = NULL;
mi->repl_state = REPL_STATE_CONNECT; mi->repl_state = REPL_STATE_CONNECT;
mi->repl_down_since = g_pserver->unixtime;
/* We lost connection with our master, don't disconnect slaves yet, /* We lost connection with our master, don't disconnect slaves yet,
* maybe we'll be able to PSYNC with our master later. We'll disconnect * maybe we'll be able to PSYNC with our master later. We'll disconnect
* the slaves only if we'll have to do a full resync with our master. */ * the slaves only if we'll have to do a full resync with our master. */
@ -3535,6 +3540,7 @@ void replicationResurrectCachedMaster(redisMaster *mi, connection *conn) {
mi->master->lastinteraction = g_pserver->unixtime; mi->master->lastinteraction = g_pserver->unixtime;
mi->repl_state = REPL_STATE_CONNECTED; mi->repl_state = REPL_STATE_CONNECTED;
mi->repl_down_since = 0; mi->repl_down_since = 0;
mi->master->repl_down_since = 0;
/* Normally changing the thread of a client is a BIG NONO, /* Normally changing the thread of a client is a BIG NONO,
but this client was unlinked so its OK here */ but this client was unlinked so its OK here */

View File

@ -61,6 +61,7 @@
#include <algorithm> #include <algorithm>
#include <uuid/uuid.h> #include <uuid/uuid.h>
#include <mutex> #include <mutex>
#include <condition_variable>
#include "aelocker.h" #include "aelocker.h"
#include "keycheck.h" #include "keycheck.h"
#include "motd.h" #include "motd.h"
@ -71,7 +72,7 @@
int g_fTestMode = false; int g_fTestMode = false;
const char *motd_url = "http://api.keydb.dev/motd/motd_server_pro.txt"; const char *motd_url = "http://api.keydb.dev/motd/motd_server_pro.txt";
const char *motd_cache_file = "/.keydb-pro-server-motd"; const char *motd_cache_file = "/.keydb-enterprise-server-motd";
#ifdef __linux__ #ifdef __linux__
#include <sys/mman.h> #include <sys/mman.h>
@ -97,6 +98,10 @@ redisServer *g_pserver = &GlobalHidden::server;
struct redisServerConst cserver; struct redisServerConst cserver;
thread_local struct redisServerThreadVars *serverTL = NULL; // thread local server vars thread_local struct redisServerThreadVars *serverTL = NULL; // thread local server vars
volatile unsigned long lru_clock; /* Server global current LRU time. */ volatile unsigned long lru_clock; /* Server global current LRU time. */
std::mutex time_thread_mutex;
std::condition_variable time_thread_cv;
int sleeping_threads = cserver.cthreads;
void wakeTimeThread();
/* Our command table. /* Our command table.
* *
@ -2440,6 +2445,14 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
/* CRON functions may trigger async writes, so do this last */ /* CRON functions may trigger async writes, so do this last */
ProcessPendingAsyncWrites(); ProcessPendingAsyncWrites();
// Measure lock contention from a different thread to be more accurate
g_pserver->asyncworkqueue->AddWorkFunction([]{
g_pserver->rglockSamples[g_pserver->ilockRingHead] = (uint16_t)aeLockContention();
++g_pserver->ilockRingHead;
if (g_pserver->ilockRingHead >= redisServer::s_lockContentionSamples)
g_pserver->ilockRingHead = 0;
});
run_with_period(10) { run_with_period(10) {
if (!g_pserver->garbageCollector.empty()) { if (!g_pserver->garbageCollector.empty()) {
// Server threads don't free the GC, but if we don't have a // Server threads don't free the GC, but if we don't have a
@ -2452,14 +2465,6 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
} }
} }
// Measure lock contention from a different thread to be more accurate
g_pserver->asyncworkqueue->AddWorkFunction([]{
g_pserver->rglockSamples[g_pserver->ilockRingHead] = (uint16_t)aeLockContention();
++g_pserver->ilockRingHead;
if (g_pserver->ilockRingHead >= redisServer::s_lockContentionSamples)
g_pserver->ilockRingHead = 0;
});
g_pserver->cronloops++; g_pserver->cronloops++;
return 1000/g_pserver->hz; return 1000/g_pserver->hz;
} }
@ -2675,6 +2680,13 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
locker.disarm(); locker.disarm();
if (!fSentReplies) if (!fSentReplies)
handleClientsWithPendingWrites(iel, aof_state); handleClientsWithPendingWrites(iel, aof_state);
{
std::lock_guard<std::mutex> lock(time_thread_mutex);
sleeping_threads++;
serverAssert(sleeping_threads <= cserver.cthreads);
}
if (moduleCount()) moduleReleaseGIL(TRUE /*fServerThread*/); if (moduleCount()) moduleReleaseGIL(TRUE /*fServerThread*/);
/* Do NOT add anything below moduleReleaseGIL !!! */ /* Do NOT add anything below moduleReleaseGIL !!! */
@ -2690,6 +2702,8 @@ void afterSleep(struct aeEventLoop *eventLoop) {
/* Aquire the modules GIL so that their threads won't touch anything. */ /* Aquire the modules GIL so that their threads won't touch anything. */
if (moduleCount()) moduleAcquireGIL(TRUE /*fServerThread*/); if (moduleCount()) moduleAcquireGIL(TRUE /*fServerThread*/);
wakeTimeThread();
serverAssert(serverTL->gcEpoch.isReset()); serverAssert(serverTL->gcEpoch.isReset());
serverTL->gcEpoch = g_pserver->garbageCollector.startEpoch(); serverTL->gcEpoch = g_pserver->garbageCollector.startEpoch();
for (int idb = 0; idb < cserver.dbnum; ++idb) for (int idb = 0; idb < cserver.dbnum; ++idb)
@ -5463,7 +5477,7 @@ sds genRedisInfoString(const char *section) {
if (sections++) info = sdscat(info,"\r\n"); if (sections++) info = sdscat(info,"\r\n");
info = sdscatprintf(info, info = sdscatprintf(info,
"# KeyDB\r\n" "# KeyDB\r\n"
"variant:pro\r\n" "variant:enterprise\r\n"
"license_status:%s\r\n" "license_status:%s\r\n"
"mvcc_depth:%d\r\n", "mvcc_depth:%d\r\n",
cserver.license_key ? "OK" : "Trial", cserver.license_key ? "OK" : "Trial",
@ -5697,19 +5711,19 @@ void version(void) {
} }
void usage(void) { void usage(void) {
fprintf(stderr,"Usage: ./keydb-pro-server [/path/to/keydb.conf] [options]\n"); fprintf(stderr,"Usage: ./keydb-server [/path/to/keydb.conf] [options]\n");
fprintf(stderr," ./keydb-pro-server - (read config from stdin)\n"); fprintf(stderr," ./keydb-server - (read config from stdin)\n");
fprintf(stderr," ./keydb-pro-server -v or --version\n"); fprintf(stderr," ./keydb-server -v or --version\n");
fprintf(stderr," ./keydb-pro-server -h or --help\n"); fprintf(stderr," ./keydb-server -h or --help\n");
fprintf(stderr," ./keydb-pro-server --test-memory <megabytes>\n\n"); fprintf(stderr," ./keydb-server --test-memory <megabytes>\n\n");
fprintf(stderr,"Examples:\n"); fprintf(stderr,"Examples:\n");
fprintf(stderr," ./keydb-pro-server (run the server with default conf)\n"); fprintf(stderr," ./keydb-server (run the server with default conf)\n");
fprintf(stderr," ./keydb-pro-server /etc/redis/6379.conf\n"); fprintf(stderr," ./keydb-server /etc/redis/6379.conf\n");
fprintf(stderr," ./keydb-pro-server --port 7777\n"); fprintf(stderr," ./keydb-server --port 7777\n");
fprintf(stderr," ./keydb-pro-server --port 7777 --replicaof 127.0.0.1 8888\n"); fprintf(stderr," ./keydb-server --port 7777 --replicaof 127.0.0.1 8888\n");
fprintf(stderr," ./keydb-pro-server /etc/mykeydb.conf --loglevel verbose\n\n"); fprintf(stderr," ./keydb-server /etc/mykeydb.conf --loglevel verbose\n\n");
fprintf(stderr,"Sentinel mode:\n"); fprintf(stderr,"Sentinel mode:\n");
fprintf(stderr," ./keydb-pro-server /etc/sentinel.conf --sentinel\n"); fprintf(stderr," ./keydb-server /etc/sentinel.conf --sentinel\n");
exit(1); exit(1);
} }
@ -5754,7 +5768,7 @@ void redisAsciiArt(void) {
if (cserver.license_key == nullptr && !g_pserver->sentinel_mode) if (cserver.license_key == nullptr && !g_pserver->sentinel_mode)
{ {
#ifndef NO_LICENSE_CHECK #ifndef NO_LICENSE_CHECK
serverLog(LL_WARNING, "!!!! KeyDB Pro is being run in trial mode !!!!"); serverLog(LL_WARNING, "!!!! KeyDB Enterprise is being run in trial mode !!!!");
serverLog(LL_WARNING, "!!!! Execution will terminate in %d minutes !!!!", cserver.trial_timeout); serverLog(LL_WARNING, "!!!! Execution will terminate in %d minutes !!!!", cserver.trial_timeout);
#endif #endif
} }
@ -6120,13 +6134,27 @@ void OnTerminate()
serverPanic("std::teminate() called"); serverPanic("std::teminate() called");
} }
void wakeTimeThread() {
updateCachedTime();
std::lock_guard<std::mutex> lock(time_thread_mutex);
sleeping_threads--;
serverAssert(sleeping_threads >= 0);
time_thread_cv.notify_one();
}
void *timeThreadMain(void*) { void *timeThreadMain(void*) {
timespec delay; timespec delay;
delay.tv_sec = 0; delay.tv_sec = 0;
delay.tv_nsec = 100; delay.tv_nsec = 100;
while (true) { while (true) {
{
std::unique_lock<std::mutex> lock(time_thread_mutex);
if (sleeping_threads >= cserver.cthreads) {
time_thread_cv.wait(lock);
}
}
updateCachedTime(); updateCachedTime();
clock_nanosleep(CLOCK_REALTIME, 0, &delay, NULL); clock_nanosleep(CLOCK_MONOTONIC, 0, &delay, NULL);
} }
} }
@ -6297,7 +6325,7 @@ int main(int argc, char **argv) {
exit(0); exit(0);
} else { } else {
fprintf(stderr,"Please specify the amount of memory to test in megabytes.\n"); fprintf(stderr,"Please specify the amount of memory to test in megabytes.\n");
fprintf(stderr,"Example: ./keydb-pro-server --test-memory 4096\n\n"); fprintf(stderr,"Example: ./keydb-server --test-memory 4096\n\n");
exit(1); exit(1);
} }
} }

View File

@ -506,10 +506,8 @@ extern int configOOMScoreAdjValuesDefaults[CONFIG_OOM_COUNT];
#define CLIENT_PENDING_READ (1<<29) /* The client has pending reads and was put #define CLIENT_PENDING_READ (1<<29) /* The client has pending reads and was put
in the list of clients we can read in the list of clients we can read
from. */ from. */
#define CLIENT_PENDING_COMMAND (1<<30) /* Used in threaded I/O to signal after #define CLIENT_EXECUTING_COMMAND (1<<30) /* Used to handle reentrency cases in processCommandWhileBlocked
we return single threaded that the to ensure we don't process a client already executing */
client has already pending commands
to be executed. */
#define CLIENT_TRACKING (1ULL<<31) /* Client enabled keys tracking in order to #define CLIENT_TRACKING (1ULL<<31) /* Client enabled keys tracking in order to
perform client side caching. */ perform client side caching. */
#define CLIENT_TRACKING_BROKEN_REDIR (1ULL<<32) /* Target client is invalid. */ #define CLIENT_TRACKING_BROKEN_REDIR (1ULL<<32) /* Target client is invalid. */
@ -1509,6 +1507,7 @@ struct client {
off_t repldboff; /* Replication DB file offset. */ off_t repldboff; /* Replication DB file offset. */
off_t repldbsize; /* Replication DB file size. */ off_t repldbsize; /* Replication DB file size. */
sds replpreamble; /* Replication DB preamble. */ sds replpreamble; /* Replication DB preamble. */
time_t repl_down_since; /* When client lost connection. */
long long read_reploff; /* Read replication offset if this is a master. */ long long read_reploff; /* Read replication offset if this is a master. */
long long reploff; /* Applied replication offset if this is a master. */ long long reploff; /* Applied replication offset if this is a master. */
long long reploff_skipped; /* Repl backlog we did not send to this client */ long long reploff_skipped; /* Repl backlog we did not send to this client */

View File

@ -41,7 +41,7 @@ if {[catch {cd tmp}]} {
# the provided configuration file. Returns the PID of the process. # the provided configuration file. Returns the PID of the process.
proc exec_instance {type dirname cfgfile} { proc exec_instance {type dirname cfgfile} {
if {$type eq "redis"} { if {$type eq "redis"} {
set prgname keydb-pro-server set prgname keydb-server
} elseif {$type eq "sentinel"} { } elseif {$type eq "sentinel"} {
set prgname keydb-sentinel set prgname keydb-sentinel
} else { } else {

View File

@ -178,11 +178,11 @@ proc create_server_config_file {filename config} {
proc spawn_server {config_file stdout stderr} { proc spawn_server {config_file stdout stderr} {
if {$::valgrind} { if {$::valgrind} {
set pid [exec valgrind --track-origins=yes --trace-children=yes --suppressions=[pwd]/src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full src/keydb-pro-server $config_file >> $stdout 2>> $stderr &] set pid [exec valgrind --track-origins=yes --trace-children=yes --suppressions=[pwd]/src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full src/keydb-server $config_file >> $stdout 2>> $stderr &]
} elseif ($::stack_logging) { } elseif ($::stack_logging) {
set pid [exec /usr/bin/env MallocStackLogging=1 MallocLogFile=/tmp/malloc_log.txt src/keydb-pro-server $config_file >> $stdout 2>> $stderr &] set pid [exec /usr/bin/env MallocStackLogging=1 MallocLogFile=/tmp/malloc_log.txt src/keydb-server $config_file >> $stdout 2>> $stderr &]
} else { } else {
set pid [exec src/keydb-pro-server $config_file >> $stdout 2>> $stderr &] set pid [exec src/keydb-server $config_file >> $stdout 2>> $stderr &]
} }
if {$::wait_server} { if {$::wait_server} {

View File

@ -187,7 +187,7 @@ proc test {name code {okpattern undefined} {options undefined}} {
} }
if {$::traceleaks} { if {$::traceleaks} {
set output [exec leaks keydb-pro-server] set output [exec leaks keydb-server]
if {![string match {*0 leaks*} $output]} { if {![string match {*0 leaks*} $output]} {
send_data_packet $::test_server_fd err "Detected a memory leak in test '$name': $output" send_data_packet $::test_server_fd err "Detected a memory leak in test '$name': $output"
} }

View File

@ -430,6 +430,21 @@ start_server {tags {"scripting"}} {
set res set res
} {102} } {102}
test {EVAL with pipelined command (No crash)} {
r flushall
r config set lua-time-limit 1
set rd [redis_deferring_client]
$rd eval {for i=1,1000000 do redis.call('set', i, 'sdfdsfd') end} 0
$rd set testkey foo
$rd get testkey
after 1200
catch {r echo "foo"} err
assert_match {BUSY*} $err
$rd read
$rd close
}
test {EVAL timeout from AOF} { test {EVAL timeout from AOF} {
# generate a long running script that is propagated to the AOF as script # generate a long running script that is propagated to the AOF as script
# make sure that the script times out during loading # make sure that the script times out during loading

View File

@ -26,7 +26,7 @@ then
while [ $((PORT < ENDPORT)) != "0" ]; do while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1)) PORT=$((PORT+1))
echo "Starting $PORT" echo "Starting $PORT"
$BIN_PATH/keydb-pro-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} $BIN_PATH/keydb-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
done done
exit 0 exit 0
fi fi

View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
# Copyright 2011 Dvir Volk <dvirsk at gmail dot com>. All rights reserved. # Copyright 2011 Dvir Volk <dvirsk at gmail dot com>. All rights reserved.
@ -37,7 +38,7 @@
# REDIS_CONFIG_FILE=/etc/redis/1234.conf \ # REDIS_CONFIG_FILE=/etc/redis/1234.conf \
# REDIS_LOG_FILE=/var/log/redis_1234.log \ # REDIS_LOG_FILE=/var/log/redis_1234.log \
# REDIS_DATA_DIR=/var/lib/redis/1234 \ # REDIS_DATA_DIR=/var/lib/redis/1234 \
# REDIS_EXECUTABLE=`command -v keydb-pro-server` ./utils/install_server.sh # REDIS_EXECUTABLE=`command -v keydb-server` ./utils/install_server.sh
# #
# This generates a redis config file and an /etc/init.d script, and installs them. # This generates a redis config file and an /etc/init.d script, and installs them.
# #
@ -129,7 +130,7 @@ fi
if [ ! -x "$REDIS_EXECUTABLE" ] ; then if [ ! -x "$REDIS_EXECUTABLE" ] ; then
_MANUAL_EXECUTION=true _MANUAL_EXECUTION=true
#get the redis executable path #get the redis executable path
_REDIS_EXECUTABLE=`command -v keydb-pro-server` _REDIS_EXECUTABLE=`command -v keydb-server`
read -p "Please select the redis executable path [$_REDIS_EXECUTABLE] " REDIS_EXECUTABLE read -p "Please select the redis executable path [$_REDIS_EXECUTABLE] " REDIS_EXECUTABLE
if [ ! -x "$REDIS_EXECUTABLE" ] ; then if [ ! -x "$REDIS_EXECUTABLE" ] ; then
REDIS_EXECUTABLE=$_REDIS_EXECUTABLE REDIS_EXECUTABLE=$_REDIS_EXECUTABLE

View File

@ -12,7 +12,7 @@
### END INIT INFO ### END INIT INFO
REDISPORT=6379 REDISPORT=6379
EXEC=/usr/local/bin/keydb-pro-server EXEC=/usr/local/bin/keydb-server
CLIEXEC=/usr/local/bin/keydb-cli CLIEXEC=/usr/local/bin/keydb-cli
PIDFILE=/var/run/redis_${REDISPORT}.pid PIDFILE=/var/run/redis_${REDISPORT}.pid

View File

@ -27,8 +27,8 @@ proc run-tests branches {
} }
# Start the Redis server # Start the Redis server
puts " starting the server... [exec ./keydb-pro-server -v]" puts " starting the server... [exec ./keydb-server -v]"
set pids [exec echo "port $::port\nloglevel warning\n" | ./keydb-pro-server - > /dev/null 2> /dev/null &] set pids [exec echo "port $::port\nloglevel warning\n" | ./keydb-server - > /dev/null 2> /dev/null &]
puts " pids: $pids" puts " pids: $pids"
after 1000 after 1000
puts " running the benchmark" puts " running the benchmark"