The package rpms/keydb.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/keydb.git/commit/?id=1bb8f6ae0f97....
Change:
+%ifarch ppc64le aarch64
Thanks.
Full change:
============
commit 1bb8f6ae0f979285da05a6055a0e0bbb2bba4b3f
Author: Jonathan Wright <jonathan(a)almalinux.org>
Date: Sat Mar 23 12:48:56 2024 -0500
initial commit
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1114fde
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/keydb-6.3.4.tar.gz
diff --git a/README.md b/README.md
deleted file mode 100644
index ebee892..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# keydb
-
-The keydb package
diff --git a/keydb-limit-systemd b/keydb-limit-systemd
new file mode 100644
index 0000000..a792937
--- /dev/null
+++ b/keydb-limit-systemd
@@ -0,0 +1,14 @@
+# If you need to change max open file limit
+# for example, when you change maxclient in configuration
+# you can change the LimitNOFILE value below.
+# See "man systemd.exec" for more information.
+
+# Slave nodes on large system may take lot of time to start.
+# You may need to uncomment TimeoutStartSec and TimeoutStopSec
+# directives below and raise their value.
+# See "man systemd.service" for more information.
+
+[Service]
+LimitNOFILE=10240
+#TimeoutStartSec=90s
+#TimeoutStopSec=90s
diff --git a/keydb-sentinel.service b/keydb-sentinel.service
new file mode 100644
index 0000000..dc50506
--- /dev/null
+++ b/keydb-sentinel.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=KeyDB Sentinel
+After=network.target
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/keydb
+ExecStart=/usr/bin/keydb-sentinel /etc/keydb/sentinel.conf --daemonize no --supervised
systemd $OPTIONS
+Type=notify
+User=keydb
+Group=keydb
+RuntimeDirectory=keydb
+RuntimeDirectoryMode=0755
+
+[Install]
+WantedBy=multi-user.target
diff --git a/keydb-sentinel.sysconfig b/keydb-sentinel.sysconfig
new file mode 100644
index 0000000..88b923b
--- /dev/null
+++ b/keydb-sentinel.sysconfig
@@ -0,0 +1 @@
+OPTIONS="--logfile /var/log/keydb/sentinel.log --unixsocket
/var/run/keydb/sentinel.sock --pidfile /var/run/keydb/sentinel.pid"
diff --git a/keydb.logrotate b/keydb.logrotate
new file mode 100644
index 0000000..0ed7ae3
--- /dev/null
+++ b/keydb.logrotate
@@ -0,0 +1,9 @@
+/var/log/keydb/*.log {
+ weekly
+ rotate 10
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ missingok
+}
diff --git a/keydb.service b/keydb.service
new file mode 100644
index 0000000..bd77611
--- /dev/null
+++ b/keydb.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=KeyDB persistent key-value database
+After=network.target
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/keydb
+ExecStart=/usr/bin/keydb-server /etc/keydb/keydb.conf --daemonize no --supervised systemd
$OPTIONS
+Type=notify
+User=keydb
+Group=keydb
+RuntimeDirectory=keydb
+RuntimeDirectoryMode=0755
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/keydb.spec b/keydb.spec
new file mode 100644
index 0000000..53c7b38
--- /dev/null
+++ b/keydb.spec
@@ -0,0 +1,227 @@
+%bcond_with tests
+
+Name: keydb
+Version: 6.3.4
+Release: 1%{?dist}
+Summary: Multithreaded Fork of Redis
+
+ExcludeArch: %{ix86}
+
+License: BSD-3-Clause AND BSD-2-Clause AND MIT
+# hiredis: BSD-3-Clause
+# hdrhistogram, jemalloc, linenoise: BSD-2-Clause
+# lua: MIT
+URL:
https://keydb.dev/
+Source0:
https://github.com/snapchat/keydb/archive/v%{version}/%{name}-%{version}....
+Source1: %{name}.logrotate
+Source2: %{name}-sentinel.service
+Source3: %{name}.service
+Source4: %{name}.sysusers
+# could have pulled this out of unpacked sources but
+# our copy has additional options pre-programmed in
+Source5: %{name}-limit-systemd
+Source6: %{name}.sysconfig
+Source7: %{name}-sentinel.sysconfig
+
+BuildRequires: gcc-c++
+BuildRequires: libuuid-devel
+BuildRequires: openssl-devel
+BuildRequires: systemd-devel
+BuildRequires: libatomic
+BuildRequires: zlib-devel
+BuildRequires: lz4-devel
+BuildRequires: libzstd-devel
+BuildRequires: snappy-devel
+BuildRequires: bzip2-devel
+BuildRequires: systemd-rpm-macros
+# for tests
+%if %{with tests}
+BuildRequires: tcl
+BuildRequires: procps-ng
+%endif
+
+Requires: logrotate
+
+Patch: use_destdir_var.patch
+
+# from deps/hiredis/hiredis.h
+Provides: bundled(hiredis) = 1.0.0
+# from deps/jemalloc/VERSION
+Provides: bundled(jemalloc) = 5.2.1
+# from deps/lua/src/lua.h
+Provides: bundled(lua-libs) = 5.1.5
+# from deps/linenoise/linenoise.h
+Provides: bundled(linenoise) = 1.0
+# from deps/hdr_histogram/README.md
+Provides: bundled(hdr_histogram) = 0.11.0
+# from deps/memkind/src/src/memkind.c
+Provides: bundled(memkind) = 1.8.0
+# from deps/rocksdb/include/rocksdb/version.h
+Provides: bundled(rocksdb) = 7.9.2
+# no version listed
+Provides: bundled(concurrentqueue)
+
+%description
+KeyDB is a multi-threaded fork of Redis, an advanced key-value store.
+It is often referred to as a data structure server since keys can contain
+strings, hashes, lists, sets and sorted sets.
+
+You can run atomic operations on these types, like appending to a string;
+incrementing the value in a hash; pushing to a list; computing set
+intersection, union and difference; or getting the member with highest
+ranking in a sorted set.
+
+In order to achieve its outstanding performance, Redis works with an
+in-memory dataset. Depending on your use case, you can persist it either
+by dumping the dataset to disk every once in a while, or by appending
+each command to a log.
+
+KeyDB also supports trivial-to-setup master-slave replication, with very
+fast non-blocking first synchronization, auto-reconnection on net split
+and so forth.
+
+Other features include Transactions, Pub/Sub, Lua scripting, Keys with a
+limited time-to-live, and configuration settings to make Redis behave like
+a cache.
+
+You can use Redis from most programming languages also.
+
+
+%package devel
+Summary: Development header for Redis module development
+# Header-Only Library (
https://fedoraproject.org/wiki/Packaging:Guidelines)
+Provides: %{name}-static = %{version}-%{release}
+Conflicts: redis-devel
+
+%description devel
+Header file required for building loadable KeyDB modules.
+
+
+%prep
+%autosetup -n KeyDB-%{version} -p1
+# these deps don't see to be used
+rm -rf deps/cpp-statsd-client
+
+mv deps/lua/COPYRIGHT COPYRIGHT-lua
+mv deps/jemalloc/COPYING COPYING-jemalloc
+mv deps/hiredis/COPYING COPYING-hiredis
+mv deps/hdr_histogram/LICENSE.txt LICENSE-hdrhistogram
+mv deps/hdr_histogram/COPYING.txt COPYING-hdrhistogram
+
+
+# See
https://bugzilla.redhat.com/2240293
+# See
https://src.fedoraproject.org/rpms/jemalloc/blob/rawhide/f/jemalloc.spec#_34
+%ifarch ppc64le aarch64
+sed -e 's/--with-lg-quantum/--with-lg-page=16 --with-lg-quantum/' -i
deps/Makefile
+%endif
+
+
+%build
+# due to makefile weirdness these flags need to be on build and install
+%make_build USE_SYSTEMD=yes PREFIX=%{_prefix} NO_MOTD=yes
+
+
+%install
+# due to makefile weirdness these flags need to be on build and install
+%make_install USE_SYSTEMD=yes PREFIX=%{_prefix} NO_MOTD=yes
+
+install -p -D -m 0644 %{S:4} %{buildroot}%{_sysusersdir}/%{name}.conf
+
+install -d %{buildroot}%{_sharedstatedir}/%{name}
+install -d %{buildroot}%{_localstatedir}/log/%{name}
+install -d %{buildroot}%{_localstatedir}/run/%{name}
+
+# Install logrotate file.
+install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
+
+# Install configuration files.
+install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
+install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}/sentinel.conf
+
+# Install systemd unit files.
+mkdir -p %{buildroot}%{_unitdir}
+install -pm644 %{S:3} %{buildroot}%{_unitdir}
+install -pm644 %{S:2} %{buildroot}%{_unitdir}
+
+# Install man pages
+built_man_dir="pkg/rpm/%{name}_build/%{name}_rpm%{_mandir}"
+for page in ${built_man_dir}/*/*; do
+ manx=$(basename $(dirname "$page"))
+ target_dir="%{buildroot}%{_mandir}/$manx"
+ mkdir -p "$target_dir"
+ install -Dpm 644 "$page" "$target_dir/"
+done
+
+# Install keydb module header
+install -Dpm 644 src/redismodule.h %{buildroot}%{_includedir}/redismodule.h
+
+# Install systemd limit files (requires systemd >= 204)
+install -Dpm 644 %{S:5}
%{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
+install -Dpm 644 %{S:5}
%{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
+
+# Install sysconfig files
+install -Dpm 644 %{S:6} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
+install -Dpm 644 %{S:7} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-sentinel
+
+%pre
+%sysusers_create_compat %{S:4}
+
+
+%post
+%systemd_post %{name}.service
+%systemd_post %{name}-sentinel.service
+
+
+%preun
+%systemd_preun %{name}.service
+%systemd_preun %{name}-sentinel.service
+
+
+%postun
+%systemd_postun_with_restart %{name}.service
+%systemd_postun_with_restart %{name}-sentinel.service
+
+
+%check
+%if %{with tests}
+make test
+%endif
+
+
+%files
+%license COPYING
+%license COPYRIGHT-lua
+%license COPYING-jemalloc
+%license COPYING-hiredis
+%license LICENSE-hdrhistogram
+%license COPYING-hdrhistogram
+%doc README.md BUGS 00-RELEASENOTES
+%{_bindir}/%{name}-*
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
+%attr(0750, keydb, root) %dir %{_sysconfdir}/%{name}
+%attr(0640, keydb, root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
+%attr(0640, keydb, root) %config(noreplace) %{_sysconfdir}/%{name}/sentinel.conf
+%{_unitdir}/%{name}.service
+%{_unitdir}/%{name}-sentinel.service
+%dir %attr(0750, keydb, keydb) %{_sharedstatedir}/%{name}
+%dir %attr(0750, keydb, keydb) %{_localstatedir}/log/%{name}
+%{_sysusersdir}/%{name}.conf
+%{_mandir}/man1/%{name}*
+%{_mandir}/man5/%{name}*
+%dir %attr(0755, keydb, keydb) %ghost %{_localstatedir}/run/%{name}
+%dir %{_sysconfdir}/systemd/system/%{name}.service.d
+%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
+%dir %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d
+%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
+%{_sysconfdir}/sysconfig/%{name}
+%{_sysconfdir}/sysconfig/%{name}-sentinel
+
+
+%files devel
+%license COPYING
+%{_includedir}/redismodule.h
+
+
+%changelog
+* Wed Mar 20 2024 Jonathan Wright <jonathan(a)almalinux.org> - 6.3.4-1
+- Initial package build
diff --git a/keydb.sysconfig b/keydb.sysconfig
new file mode 100644
index 0000000..3d5b747
--- /dev/null
+++ b/keydb.sysconfig
@@ -0,0 +1 @@
+OPTIONS="--logfile /var/log/keydb/keydb.log --dir /var/lib/keydb --unixsocket
/var/run/keydb/keydb.sock --enable-motd no --pidfile /var/run/keydb/keydb.pid"
diff --git a/keydb.sysusers b/keydb.sysusers
new file mode 100644
index 0000000..2477fc2
--- /dev/null
+++ b/keydb.sysusers
@@ -0,0 +1 @@
+u keydb - "KeyDB Database Server" /dev/null /sbin/nologin
diff --git a/sources b/sources
new file mode 100644
index 0000000..7db3f01
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (keydb-6.3.4.tar.gz) =
6ac5060dc60df878668830336821cac740690be5525bc8c4a31a522c629b73df2da49f6d53fe8ebfec171efef258c9253d91243fe57a470aaabeddea2ac5247b
diff --git a/use_destdir_var.patch b/use_destdir_var.patch
new file mode 100644
index 0000000..2e21134
--- /dev/null
+++ b/use_destdir_var.patch
@@ -0,0 +1,272 @@
+diff -uNr KeyDB-6.2.2.orig/src/Makefile KeyDB-6.2.2/src/Makefile
+--- KeyDB-6.2.2.orig/src/Makefile 2022-09-22 17:20:16.255466414 -0500
++++ KeyDB-6.2.2/src/Makefile 2022-09-22 17:25:02.043958294 -0500
+@@ -512,13 +512,13 @@
+ @../utils/generate-command-help.rb > help.h
+
+ install: all
+- @mkdir -p $(INSTALL_BIN)
+- $(call MAKE_INSTALL,$(REDIS_SERVER_NAME),$(INSTALL_BIN))
+- $(call MAKE_INSTALL,$(REDIS_BENCHMARK_NAME),$(INSTALL_BIN))
+- $(call MAKE_INSTALL,$(REDIS_CLI_NAME),$(INSTALL_BIN))
+- @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_CHECK_RDB_NAME)
+- @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_CHECK_AOF_NAME)
+- @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_SENTINEL_NAME)
++ @mkdir -p $(DESTDIR)$(INSTALL_BIN)
++ $(call MAKE_INSTALL,$(REDIS_SERVER_NAME),$(DESTDIR)$(INSTALL_BIN))
++ $(call MAKE_INSTALL,$(REDIS_BENCHMARK_NAME),$(DESTDIR)$(INSTALL_BIN))
++ $(call MAKE_INSTALL,$(REDIS_CLI_NAME),$(DESTDIR)$(INSTALL_BIN))
++ @ln -sf $(REDIS_SERVER_NAME) $(DESTDIR)$(INSTALL_BIN)/$(REDIS_CHECK_RDB_NAME)
++ @ln -sf $(REDIS_SERVER_NAME) $(DESTDIR)$(INSTALL_BIN)/$(REDIS_CHECK_AOF_NAME)
++ @ln -sf $(REDIS_SERVER_NAME) $(DESTDIR)$(INSTALL_BIN)/$(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),$(KEYDB_DIAGNOSTIC_NAME)}
++ rm -f
$(DESTDIR)$(INSTALL_BIN)/{$(REDIS_SERVER_NAME),$(REDIS_BENCHMARK_NAME),$(REDIS_CLI_NAME),$(REDIS_CHECK_RDB_NAME),$(REDIS_CHECK_AOF_NAME),$(REDIS_SENTINEL_NAME),$(KEYDB_DIAGNOSTIC_NAME)}
+diff -uNr KeyDB-6.2.2.orig/tests/test_helper.tcl KeyDB-6.2.2/tests/test_helper.tcl
+--- KeyDB-6.2.2.orig/tests/test_helper.tcl 2022-09-22 17:20:16.261466487 -0500
++++ KeyDB-6.2.2/tests/test_helper.tcl 2022-09-22 17:44:21.039374195 -0500
+@@ -68,7 +68,6 @@
+ unit/limits
+ unit/obuf-limits
+ unit/bitops
+- unit/bitfield
+ unit/geo
+ unit/memefficiency
+ unit/hyperloglog
+diff -uNr KeyDB-6.2.2.orig/tests/unit/bitfield.tcl KeyDB-6.2.2/tests/unit/bitfield.tcl
+--- KeyDB-6.2.2.orig/tests/unit/bitfield.tcl 2022-09-22 17:20:16.263466511 -0500
++++ KeyDB-6.2.2/tests/unit/bitfield.tcl 1969-12-31 18:00:00.000000000 -0600
+@@ -1,232 +0,0 @@
+-start_server {tags {"bitops"}} {
+- test {BITFIELD signed SET and GET basics} {
+- r del bits
+- set results {}
+- lappend results [r bitfield bits set i8 0 -100]
+- lappend results [r bitfield bits set i8 0 101]
+- lappend results [r bitfield bits get i8 0]
+- set results
+- } {0 -100 101}
+-
+- test {BITFIELD unsigned SET and GET basics} {
+- r del bits
+- set results {}
+- lappend results [r bitfield bits set u8 0 255]
+- lappend results [r bitfield bits set u8 0 100]
+- lappend results [r bitfield bits get u8 0]
+- set results
+- } {0 255 100}
+-
+- test {BITFIELD #<idx> form} {
+- r del bits
+- set results {}
+- r bitfield bits set u8 #0 65
+- r bitfield bits set u8 #1 66
+- r bitfield bits set u8 #2 67
+- r get bits
+- } {ABC}
+-
+- test {BITFIELD basic INCRBY form} {
+- r del bits
+- set results {}
+- r bitfield bits set u8 #0 10
+- lappend results [r bitfield bits incrby u8 #0 100]
+- lappend results [r bitfield bits incrby u8 #0 100]
+- set results
+- } {110 210}
+-
+- test {BITFIELD chaining of multiple commands} {
+- r del bits
+- set results {}
+- r bitfield bits set u8 #0 10
+- lappend results [r bitfield bits incrby u8 #0 100 incrby u8 #0 100]
+- set results
+- } {{110 210}}
+-
+- test {BITFIELD unsigned overflow wrap} {
+- r del bits
+- set results {}
+- r bitfield bits set u8 #0 100
+- lappend results [r bitfield bits overflow wrap incrby u8 #0 257]
+- lappend results [r bitfield bits get u8 #0]
+- lappend results [r bitfield bits overflow wrap incrby u8 #0 255]
+- lappend results [r bitfield bits get u8 #0]
+- } {101 101 100 100}
+-
+- test {BITFIELD unsigned overflow sat} {
+- r del bits
+- set results {}
+- r bitfield bits set u8 #0 100
+- lappend results [r bitfield bits overflow sat incrby u8 #0 257]
+- lappend results [r bitfield bits get u8 #0]
+- lappend results [r bitfield bits overflow sat incrby u8 #0 -255]
+- lappend results [r bitfield bits get u8 #0]
+- } {255 255 0 0}
+-
+- test {BITFIELD signed overflow wrap} {
+- r del bits
+- set results {}
+- r bitfield bits set i8 #0 100
+- lappend results [r bitfield bits overflow wrap incrby i8 #0 257]
+- lappend results [r bitfield bits get i8 #0]
+- lappend results [r bitfield bits overflow wrap incrby i8 #0 255]
+- lappend results [r bitfield bits get i8 #0]
+- } {101 101 100 100}
+-
+- test {BITFIELD signed overflow sat} {
+- r del bits
+- set results {}
+- r bitfield bits set u8 #0 100
+- lappend results [r bitfield bits overflow sat incrby i8 #0 257]
+- lappend results [r bitfield bits get i8 #0]
+- lappend results [r bitfield bits overflow sat incrby i8 #0 -255]
+- lappend results [r bitfield bits get i8 #0]
+- } {127 127 -128 -128}
+-
+- test {BITFIELD overflow detection fuzzing} {
+- for {set j 0} {$j < 1000} {incr j} {
+- set bits [expr {[randomInt 64]+1}]
+- set sign [randomInt 2]
+- set range [expr {2**$bits}]
+- if {$bits == 64} {set sign 1} ; # u64 is not supported by BITFIELD.
+- if {$sign} {
+- set min [expr {-($range/2)}]
+- set type "i$bits"
+- } else {
+- set min 0
+- set type "u$bits"
+- }
+- set max [expr {$min+$range-1}]
+-
+- # Compare Tcl vs Redis
+- set range2 [expr {$range*2}]
+- set value [expr {($min*2)+[randomInt $range2]}]
+- set increment [expr {($min*2)+[randomInt $range2]}]
+- if {$value > 9223372036854775807} {
+- set value 9223372036854775807
+- }
+- if {$value < -9223372036854775808} {
+- set value -9223372036854775808
+- }
+- if {$increment > 9223372036854775807} {
+- set increment 9223372036854775807
+- }
+- if {$increment < -9223372036854775808} {
+- set increment -9223372036854775808
+- }
+-
+- set overflow 0
+- if {$value > $max || $value < $min} {set overflow 1}
+- if {($value + $increment) > $max} {set overflow 1}
+- if {($value + $increment) < $min} {set overflow 1}
+-
+- r del bits
+- set res1 [r bitfield bits overflow fail set $type 0 $value]
+- set res2 [r bitfield bits overflow fail incrby $type 0 $increment]
+-
+- if {$overflow && [lindex $res1 0] ne {} &&
+- [lindex $res2 0] ne {}} {
+- fail "OW not detected where needed: $type $value+$increment"
+- }
+- if {!$overflow && ([lindex $res1 0] eq {} ||
+- [lindex $res2 0] eq {})} {
+- fail "OW detected where NOT needed: $type $value+$increment"
+- }
+- }
+- }
+-
+- test {BITFIELD overflow wrap fuzzing} {
+- for {set j 0} {$j < 1000} {incr j} {
+- set bits [expr {[randomInt 64]+1}]
+- set sign [randomInt 2]
+- set range [expr {2**$bits}]
+- if {$bits == 64} {set sign 1} ; # u64 is not supported by BITFIELD.
+- if {$sign} {
+- set min [expr {-($range/2)}]
+- set type "i$bits"
+- } else {
+- set min 0
+- set type "u$bits"
+- }
+- set max [expr {$min+$range-1}]
+-
+- # Compare Tcl vs Redis
+- set range2 [expr {$range*2}]
+- set value [expr {($min*2)+[randomInt $range2]}]
+- set increment [expr {($min*2)+[randomInt $range2]}]
+- if {$value > 9223372036854775807} {
+- set value 9223372036854775807
+- }
+- if {$value < -9223372036854775808} {
+- set value -9223372036854775808
+- }
+- if {$increment > 9223372036854775807} {
+- set increment 9223372036854775807
+- }
+- if {$increment < -9223372036854775808} {
+- set increment -9223372036854775808
+- }
+-
+- r del bits
+- r bitfield bits overflow wrap set $type 0 $value
+- r bitfield bits overflow wrap incrby $type 0 $increment
+- set res [lindex [r bitfield bits get $type 0] 0]
+-
+- set expected 0
+- if {$sign} {incr expected [expr {$max+1}]}
+- incr expected $value
+- incr expected $increment
+- set expected [expr {$expected % $range}]
+- if {$sign} {incr expected $min}
+-
+- if {$res != $expected} {
+- fail "WRAP error: $type $value+$increment = $res, should be
$expected"
+- }
+- }
+- }
+-
+- test {BITFIELD regression for #3221} {
+- r set bits 1
+- r bitfield bits get u1 0
+- } {0}
+-
+- test {BITFIELD regression for #3564} {
+- for {set j 0} {$j < 10} {incr j} {
+- r del mystring
+- set res [r BITFIELD mystring SET i8 0 10 SET i8 64 10 INCRBY i8 10 99900]
+- assert {$res eq {0 0 60}}
+- }
+- r del mystring
+- }
+-}
+-
+-start_server {tags {"repl"}} {
+- start_server {} {
+- set master [srv -1 client]
+- set master_host [srv -1 host]
+- set master_port [srv -1 port]
+- set slave [srv 0 client]
+-
+- test {BITFIELD: setup slave} {
+- $slave slaveof $master_host $master_port
+- wait_for_condition 50 100 {
+- [s 0 master_link_status] eq {up}
+- } else {
+- fail "Replication not started."
+- }
+- }
+-
+- test {BITFIELD: write on master, read on slave} {
+- $master del bits
+- assert_equal 0 [$master bitfield bits set u8 0 255]
+- assert_equal 255 [$master bitfield bits set u8 0 100]
+- wait_for_ofs_sync $master $slave
+- assert_equal 100 [$slave bitfield_ro bits get u8 0]
+- }
+-
+- test {BITFIELD_RO fails when write option is used} {
+- catch {$slave bitfield_ro bits set u8 0 100 get u8 0} err
+- assert_match {*ERR BITFIELD_RO only supports the GET subcommand*} $err
+- }
+- }
+-}