Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
637f716
Add missing UPDATE key spec for HGETEX command (#4576)
ranshid Aug 31, 2026
8755cb1
Remove the static compression buffer, over-allocate instead (#4539)
dubey02 Aug 31, 2026
279b07f
Compare the certificate CN over its whole length (#4577)
madolson Aug 31, 2026
8d34678
Add per-direction cluster link established counter info fields (#4169)
enjoy-binbin Sep 1, 2026
f1addd8
Use BIO thread for cluster config saving in cluster-config-save-behav…
enjoy-binbin Sep 1, 2026
f2c1c5e
Speed up split-vote elections with the new FAILOVER_AUTH_NACK message…
enjoy-binbin Sep 1, 2026
a9963f4
Bump fast-uri to 3.1.6 in reply-schema-linter to clear CVEs (#4571)
stavBenShahar Sep 1, 2026
47b497e
Fix stale MY_PRIMARY_FAIL gossip flag (#4533)
charsyam Sep 1, 2026
9ab6641
SET: add IFNE conditional option (#3105)
arshidkv12 Sep 1, 2026
a147166
Add server-side hot key detection (#3708)
alon-arenberg Sep 1, 2026
7507a93
Include module version in module load log message (#4566)
enjoy-binbin Sep 1, 2026
205fde3
Fix test_reclaimFilePageCache to avoid tmpfs (#4362)
Baraa-Hasheesh Sep 1, 2026
1cca6d6
Introduce steady-state replication throttling and throttling infrastr…
harrylin98 Sep 1, 2026
12f9331
tests/rdma: improve diagnostics for sporadic connection failures (#4586)
quanyeyang Sep 1, 2026
d195632
Fix ping_sent getting stuck when peer traffic keeps link alive (#4171)
enjoy-binbin Sep 2, 2026
0413e37
Deflake throttle-repl test due to timeout disconnect (#4591)
harrylin98 Sep 2, 2026
5c11f8c
Optimize HMGET, SMISMEMBER and ZMSCORE with batched hashtable lookup …
chzhoo Sep 2, 2026
075b7d5
Fix scripts_mem accounting for LRU script SHA copies (#4587)
enjoy-binbin Sep 3, 2026
351eb0c
Tear down repl throttler when the last replica disconnects (#4595)
harrylin98 Sep 3, 2026
acba5dd
Forkless Save (#4460)
JimB123 Sep 3, 2026
0a631f0
revert typo config change (#4603)
JimB123 Sep 3, 2026
1dbf193
Only scan this test's own AOF writes for the LIMIT token (#4601)
madolson Sep 4, 2026
bb74166
Reject non-migration clients for CLUSTER SYNCSLOTS FINISH (#4330)
enjoy-binbin Sep 4, 2026
da9d58f
improper int to bit-flag conversion (#4609)
JimB123 Sep 4, 2026
85d02f6
Fix duplicate reply on FLUSHDB/FLUSHALL with invalid args in forkless…
JimB123 Sep 5, 2026
bcc60f7
Fix timing issue in WATCHed key in another slot that expired aborts E…
enjoy-binbin Sep 7, 2026
e1126ce
valkey-benchmark: remove cross-thread contention from the hot path (#…
rainsupreme Sep 8, 2026
05df39d
Move build-debian-old CI job to Debian Bookworm (#4613)
rainsupreme Sep 8, 2026
2d44c74
Nested prefetching for hash and zset inner hashtables (#3940)
roshkhatri Sep 9, 2026
7a681df
Deflake slow slot migration snapshot test (#4640)
sarthakaggarwal97 Sep 9, 2026
c27cc74
Tests: scale wait_process_paused when the pause depends on a fork (#4…
madolson Sep 10, 2026
2f3bcea
Cluster Bus IO offload (#3438)
hpatro Sep 10, 2026
f9f1b3e
Making the module global-defrag callback usable (#4487)
Aksha1812 Sep 10, 2026
202a480
bgiteration: fix unit-test feed deadlock under slow execution (#4643)
Aksha1812 Sep 10, 2026
c80da01
Listpack encoding for Hash field expiration (#3212)
frostzt Sep 10, 2026
d465652
Implement XACKDEL and XDELEX command (#4629)
nickiaq Sep 10, 2026
95e0e9a
Add AUTH options to CLUSTER MIGRATESLOTS (#3538)
nemtsv Sep 10, 2026
98f9152
Fix XPENDING reply schema for empty pending lists (#4653)
sarthakaggarwal97 Sep 11, 2026
ed9dc9f
Count dual-channel rdb-channel bytes in replication input stats
roshkhatri Sep 2, 2026
4be324e
Streaming Compression support for fullsync
roshkhatri Sep 2, 2026
13c66b8
Fail fast on empty CA directory at TLS config load (#3522)
yang-z-o Sep 11, 2026
03a7447
Add support for secondary certificates (#3717)
pkhartsk Sep 11, 2026
da91ccd
Fix double-promotion compilation error in test_util.cpp (#4624)
Baraa-Hasheesh Sep 11, 2026
5810f5b
Remove duplicate c->flag.blocked check (#4617)
Baraa-Hasheesh Sep 14, 2026
1e90169
Track field TTLs in the volatile set when a HASH_2 load converts mid-…
madolson Sep 14, 2026
1827741
Reject repeated CLUSTER SYNCSLOTS ESTABLISH on the same connection (#…
Pyolar Sep 14, 2026
bef4c95
Add test case for forkless FLUSHDB/FLUSHALL duplicate reply (#4605)
enjoy-binbin Sep 14, 2026
089321a
perf: combined post-command pending-work gate in afterCommand() (#4257)
ahmetalicc Sep 14, 2026
88a5360
QoS for system critical events ( such as cluster heartbeats, replicat…
satheeshaGowda Sep 14, 2026
63f56bd
Implement `VM_IncrExternalMemory` and `VM_DecrExternalMemory` (#4128)
bandalgomsu Sep 14, 2026
f26b160
Fix repl throttle read-handler and throttle_checked ordering, improve…
harrylin98 Sep 14, 2026
f42c9ab
Reserve connection slots for priority sources (#4005)
satheeshaGowda Sep 14, 2026
0adf657
Add `IFEQ`, `IFNE`, `XX`, and `NX` options to `EXEC` command (#4019)
bandalgomsu Sep 14, 2026
754d9f1
zset bugfix - Fix lex range sentinel handling in the ordered index (#…
rainsupreme Sep 15, 2026
cd79e02
zset bugfix - Fix btree score range resolution and prefix staleness (…
rainsupreme Sep 15, 2026
6ae7eb4
Introduce INCREX command (#3253)
GavinDmello Sep 15, 2026
05a9c29
Add cluster-replica-no-failover if-empty to block failover from empty…
enjoy-binbin Sep 15, 2026
74793bd
Check the SORT destination that is actually written (#4665)
madolson Sep 15, 2026
06d35ac
tests/rdma: isolate RXE from host RDMA devices (#4593)
quanyeyang Sep 15, 2026
ae2ab6b
Add optional XX to SISMEMBER; return -1 if the key does not exist (#2…
li-benson Sep 15, 2026
c0739a2
Fix missing signalModifiedKey calls for stream commands (#3459)
Tarte12 Sep 15, 2026
6163991
Add ACL role support (#3967)
yang-z-o Sep 15, 2026
22b3faa
New maxmemory-scripts config to limit EVAL scripts memory, add DENYOO…
enjoy-binbin Sep 15, 2026
6225ee7
Add VM_ScanKeyRawBorrowed to allow scanning keys without allocating (…
KarthikSubbarao Sep 15, 2026
66f9618
Streaming Compression support for Replication (#3853)
roshkhatri Sep 15, 2026
d6415e7
Fix return types of three module API declarations to match definition…
rainsupreme Sep 16, 2026
80a04ad
Keep writing until the repl throttler activates in throttle tests
madolson Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .config/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ Collet = "Collet" # LZ4 author Yann Collet
nd = "nd"
Ba = "Ba"
Addd = "Addd"
forkless = "forkless"

[default.extend-identifiers]
dbe = "dbe"

[default]
extend-ignore-re = [
"SELECTed",
"SELECTs",
"WATCHed",
"AIMD",
]

[type.c]
Expand All @@ -39,6 +45,11 @@ extend-ignore-re = [
"DUMPed",
]

[type.sh]
extend-ignore-re = [
"passin", # gen-test-certs.sh
]

[type.c.extend-identifiers]
advices = "advices"
clen = "clen"
Expand All @@ -59,6 +70,7 @@ seeked = "seeked"

[type.c.extend-words]
arange = "arange"
Forkless = "Forkless"
fo = "fo"
frst = "frst"
limite = "limite"
Expand All @@ -67,13 +79,13 @@ pn = "pn"
seeked = "seeked"
tre = "tre"

[type.cpp.extend-words]
fo = "fo"

[type.systemd.extend-words]
# systemd = .conf
ake = "ake"

[type.tcl.extend-words]
fo = "fo"
tre = "tre"

[type.cpp.extend-words]
fo = "fo"
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ jobs:
- name: test
run: sudo ./runtest-rdma --install-rxe
- name: show-kernel-log
if: always()
run: sudo dmesg -c

test-tls-only:
Expand All @@ -199,7 +200,7 @@ jobs:

build-debian-old:
runs-on: ubuntu-latest
container: debian:bullseye
container: debian:bookworm
steps:
- name: Install libbacktrace
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ cmake-build-debug/
cmake-build-release/
__pycache__
src/unit/.flags
valkey-unit-tests
src/.idea/*
10 changes: 9 additions & 1 deletion cmake/Modules/SourceFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# valkey-server source files
set(VALKEY_SERVER_SRCS
${CMAKE_SOURCE_DIR}/src/threads_mngr.c
${CMAKE_SOURCE_DIR}/src/forkless.c
${CMAKE_SOURCE_DIR}/src/adlist.c
${CMAKE_SOURCE_DIR}/src/vector.c
${CMAKE_SOURCE_DIR}/src/quicklist.c
Expand Down Expand Up @@ -38,6 +39,7 @@ set(VALKEY_SERVER_SRCS
${CMAKE_SOURCE_DIR}/src/t_hash.c
${CMAKE_SOURCE_DIR}/src/config.c
${CMAKE_SOURCE_DIR}/src/aof.c
${CMAKE_SOURCE_DIR}/src/bgiteration.c
${CMAKE_SOURCE_DIR}/src/pubsub.c
${CMAKE_SOURCE_DIR}/src/multi.c
${CMAKE_SOURCE_DIR}/src/debug.c
Expand Down Expand Up @@ -126,7 +128,13 @@ set(VALKEY_SERVER_SRCS
${CMAKE_SOURCE_DIR}/src/queues.c
${CMAKE_SOURCE_DIR}/src/compression.c
${CMAKE_SOURCE_DIR}/src/compression_lz4.c
${CMAKE_SOURCE_DIR}/src/compression_stream.c)
${CMAKE_SOURCE_DIR}/src/compression_stream.c
${CMAKE_SOURCE_DIR}/src/hotkeys.c
${CMAKE_SOURCE_DIR}/src/space_saving.c
${CMAKE_SOURCE_DIR}/src/throttle_token_bucket.c
${CMAKE_SOURCE_DIR}/src/stat_calc.c
${CMAKE_SOURCE_DIR}/src/throttle_repl.c
${CMAKE_SOURCE_DIR}/src/throttle.c)


# valkey-cli
Expand Down
57 changes: 57 additions & 0 deletions design-docs/io-threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,67 @@ policy: ignite when main-thread active time crosses
non-empty, scale down after `IO_COOLDOWN_MS` of idle. `io-threads-always-active`
disables the policy and keeps all configured workers awake.

## Cluster Bus I/O

Cluster bus reads, writes, and the inbound TLS handshake run on the same worker
pool as client I/O. The main thread alone applies cluster packets and mutates
cluster state; workers do transport work only.

Scope: the **outbound** handshake is not offloaded. `connTLSAccept` has an
offload hook, `connTLSConnect` does not, so `SSL_connect` still runs on the main
thread from `tlsHandleEvent`. Links are bidirectional and the bus uses mutual
TLS, so roughly half the handshake cost stays on the main thread; offloading
connect is planned follow-up work.

Key design decisions:

- **Read framing boundary.** Workers read into `clusterLink->rcvbuf`, scan
the prefix of complete packets, and publish `io_complete_bytes` /
`io_complete_packets`. The main thread drains exactly that prefix on
completion, then shrinks `rcvbuf` around any leftover partial packet.
- **Write snapshot boundary.** A single canonical `send_msg_queue` is shared
with the worker via `io_last_send_block` + `io_head_offset`. New messages
enqueued while a write is in flight are picked up by the next dispatch.
- **Bounded jobs.** A read job stops at `RCVBUF_MAX_PREALLOC`, a write job at
`NET_MAX_WRITES_PER_EVENT`, so one link cannot hold a worker or balloon its
buffer. The remainder goes out on the next event.
- **Read and write are mutually exclusive per link**, because both directions
share the connection: TLS forbids concurrent use of one `SSL` object, and both
workers classify errors from `conn->state`. A one-shot yield
(`io_read_deferred`) keeps a permanently backlogged send queue from starving
reads, since `CONN_FLAG_WRITE_BARRIER` fires writable first.
- **Deferred teardown.** `freeClusterLink()` defers final free via
`io_refs > 0` + `async_close = 1`; the last completion drops the ref and
frees the link. For links, `io_refs` alone guards connection lifetime.
- **Accept serialization.** `CONN_FLAG_ACCEPT_OFFLOAD_PENDING` ensures only
one accept job is in flight per connection across TLS retries, and
`clusterConnAcceptHandler` is installed as `conn_handler` before dispatch so
every completion path finishes the accept. The generic accept path uses
`ConnectionOwnerKind` to route cluster-owned connections back to the cluster
dispatcher. Only TLS accepts are offloaded; a plain TCP accept does no real
work.
- **Read/write dispatch is skipped until the connection is established.** A link
mid-connect or mid-handshake is left to the connection layer, which drives the
read/write handler once connected. This guards the data path; it says nothing
about offloading the handshake itself.
- **Fallback.** If dispatch returns `C_ERR`, the caller runs the I/O on
the main thread and increments `cluster_io_main_thread_fallbacks`. Dispatch
needs an already-active pool, so on a lightly loaded node most cluster bus I/O
takes this path.

`CLUSTER INFO` reports `cluster_io_threaded_reads_processed`,
`cluster_io_threaded_writes_processed`,
`cluster_io_threaded_accepts_processed` (all counted when a worker job
completes) and `cluster_io_main_thread_fallbacks`.

## Relevant Code

- `src/io_threads.{c,h}` — main thread dispatch helpers, worker loop,
scaling policy.
- `src/queues.{c,h}` — SPMC, MPSC, and SPSC queue primitives.
- `src/networking.c` — client read/write handlers invoked from worker job
dispatch (`ioThreadReadQueryFromClient`, `ioThreadWriteToClient`).
- `src/cluster_legacy.c` — cluster bus worker jobs (`clusterReadJob`,
`clusterWriteJob`, `clusterAcceptJob`) and their main-thread completions
(`clusterHandleReadCompletion`, `clusterHandleWriteCompletion`,
`clusterHandleAcceptCompletion`).
10 changes: 9 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ ENGINE_SERVER_OBJ = \
allocator_defrag.o \
anet.o \
aof.o \
bgiteration.o \
bio.o \
bitops.o \
blocked.o \
Expand Down Expand Up @@ -507,11 +508,14 @@ ENGINE_SERVER_OBJ = \
expire.o \
fbtree.o \
fifo.o \
forkless.o \
functions.o \
geo.o \
geohash.o \
geohash_helper.o \
hashtable.o \
hotkeys.o \
space_saving.o \
hyperloglog.o \
intset.o \
io_threads.o \
Expand Down Expand Up @@ -586,7 +590,11 @@ ENGINE_SERVER_OBJ = \
ziplist.o \
zipmap.o \
zmalloc.o \
queues.o
queues.o \
throttle_token_bucket.o \
stat_calc.o \
throttle_repl.o \
throttle.o
ENGINE_SERVER_OBJ+=$(ENGINE_TRACE_OBJ)
ENGINE_CLI_NAME=$(ENGINE_NAME)-cli$(PROG_SUFFIX)
ENGINE_CLI_OBJ = \
Expand Down
Loading
Loading