Evaluate the use of compression (various algorithms - zstd/lz4/zlib) for on-disk storage to reduce disk footprint and improve I/O throughput. What are the pros and cons of each algorithm in terms of compression ratio, speed, and resource usage? How does compression affect the performance of read/write operations, especially for large datasets and very I/O heavy clients? Consider implementing a configurable option to enable/disable compression based on administrator preference or workload characteristics.
- CoW storage needs to expose the on-disk format version, such that we can identify old stores on newer pace-kv versions with a newer on-disk format (to gracefully bail, or migrate)
- Add valgrind memcheck CI job to ensure no memory issues on clang release build
- Github CI should create a static
pace-kvbinary and provide it as artifact. - Add
pace-kv statscommand to show in-process stats of the currently running instance (assuming we auto-detect it via config file) - Add
pace-kv live-statscommand to show in-process stats live on the terminal (using Sixels, if supported by the connected terminal, otherwise Unicode or ASCII art) - Reactor
UpdateInterestswallows realkevent/epoll_ctlfailures — surface them instead of stalling. See risk note below. Done — and the hazard was not hypothetical:KqueueReactor::UpdateInterestsubmitted both filter changes in onekevent()changelist with no eventlist, so the benignENOENTon theEVFILT_READdelete aborted the batch before theEVFILT_WRITEadd was applied. Every reply too large for the socket send buffer parked forever. Fixed withEV_RECEIPT(per-change results, no early abort); park sites now fail the awaitable instead of suspending when arming fails. Regression tests inNet/KqueueSocket_test.cpp. - Data-driven
ConfigMerge(review follow-up — Group D #12). The currentMerge()insrc/Pace/Config/ConfigMerge.cppis 25 hand-rolled if-branches; adding a Config field requires touching Config + CliResult bit + CliParser + YamlReader + Merge, and thelruRecency/cpuAffinitysilent-drop bug from the transactions-keyspace-dual-listener review was the predictable consequence. Replace the if-ladder with a descriptor table ({explicit-bit-getter, src-field-getter, dst-field-setter, mode}, wheremodeis one ofExplicitWins/NonDefaultWins) and a coverage test that asserts everyCliResult::*Explicitbit is referenced by exactly one descriptor — that guard fails fast the next time someone adds a field without wiring it into Merge. - Startup-failure log on partial bind (review follow-up — Group D #14).
RunMultiReactorPosixinsrc/Pace/Server/ReactorServerLoop.cppbindsreactorCount × bindslisteners. When one bind fails mid-loop, the function logs a generic "cannot bind A:P on reactor R" and returns; the storage chain and reloader thread are already running. Add anOnBindFailurelog path that names which (reactorIndex, bindIndex) pair failed and surfaces the kernel errno verbatim, so the operator can distinguish "port already in use on reactor 0" from "fd-table exhaustion on reactor 14". Inject a fake listener factory inReactorServerLoop_test.cpp(create if absent) that succeeds for the first N calls then fails, assert the message names the offending pair. - HTTP/1.1 + JSON REST wire protocol (extra-clients survey, option B).
Add an HTTP/1.1 listener that speaks JSON for
GET /v1/keys/:k,PUT /v1/keys/:k,DELETE /v1/keys/:k,HEAD /v1/keys/:k(TTL),PATCH /v1/keys/:k(CAS),POST /v1/batch,GET /stats,GET /healthz. Unlocks curl, browserfetch, serverless platforms that ban raw TCP, k8s sidecars, Prometheus-style scrapers. Architecture: newHttpRestIProtocolHandlerundersrc/Pace/Protocol/— verb routing must be data-driven (descriptor table of{method, path-shape, engine-call}, not a hand-rolledif/switchladder). Listener selection: introduceBindConfig::protocol(enumauto | http | resp | memcached-text | memcached-binary) so HTTP gets its own port and theProtocolAutodetectone-byte peek stays unambiguous (HTTP method letters collide with Memcached text verbs). Future hook (out of scope for the first cut): WebSocket upgrade on the same listener gives browsers a bidirectional channel for the existing keyspace notifier — reusesIPubSubRegistry, no engine change. - Add support for Tracy (via CMake variable, off by default)
- disk storage should be btrfs-like copy-on-write to allow O(1) blocking disk saves
Resolved. Kept for the reasoning, which turned out to under-state the problem. The note assumed a
falsereturn was unreachable in practice; the actual failure needed no error at all, just kqueue's documented changelist semantics — anENOENTon the first change silently dropped the second. See the closed item at the top of this file.
Context. KqueueSocket.cpp / EpollSocket.cpp call the reactor's
[[nodiscard]] bool Attach(...) and bool UpdateInterest(...) at fire-and-forget
sites and discard the result with std::ignore. Adding the macOS CI job surfaced
this on the kqueue side (-Werror,-Wunused-result); the epoll side already did it.
Is ignoring the return safe? Mostly yes, today — but it hides a stability hazard.
- Both methods return
falseonly on precondition violations (handler == nullptr,fd < 0, dead reactor_kq/epfd < 0). At every ignore site the fd was just created/accepted and is known-valid, sofalseis unreachable in practice. Ignoring a value that is alwaystrueis harmless. - The genuinely risky part is inside
UpdateInterest: the real::kevent(...)(resp.epoll_ctl) result is itself(void)-discarded, so atruereturn does not mean the kernel accepted the interest change. The discard is intentional for the benignENOENT-on-EV_DELETEcase, but it also swallows every other failure (EINVAL,ENOMEM,EMFILE/fd-table pressure, etc.).
Stability impact. If an interest-arming call fails for a non-benign reason, the reactor silently stops delivering readiness for that fd. The owning connection coroutine then suspends and never resumes — a silent, permanent per-connection stall with a leaked fd, rather than a clean error the client can observe and retry. For a long-lived daemon whose primary goal is stability, a silent hang is a worse failure mode than a reported error. This affects Linux and macOS equally.
Recommendation (not blocking; tracked above).
- Distinguish benign
ENOENT-on-delete from real failures insideUpdateInterest; on a real arming failure, propagate it so the pendingIoAwaitableis completed with an error (clean connection teardown) instead of stalling. Apply symmetrically toEpollReactorandKqueueReactor. - Once failures are reportable, reconsider the call-site contract: either keep
std::ignoreonly where the return is provably non-actionable, orassert()the precondition-only sites to catch misuse in debug builds. - Leaving
std::ignorein place for now is an acceptable interim state — it matches the existing epoll behaviour and does not regress anything — but the silent-failure swallow in (1) is the real fix for the stated stability goal.