Repository navigation
Added
-
AOF rewrite on a background thread:
BGREWRITEAOFand automatic rewrites (auto-aof-rewrite-percentage,auto-aof-rewrite-min-size) replace the AOF with a snapshot of the live dataset, so it no longer grows without bound, and the server keeps serving while it runs. The store has no locks, so the rewrite thread never touches it: it replays the existing AOF into a private store (what a restart would load), writes strings (with TTLs), lists and time series as commands to a temp file, copies the log written meanwhile, and the writer thread splices on the last bytes, fsyncs, and atomically renames it into place. On 400k keys it took about 0.5 s withPINGlatency unchanged. It needs memory for a second copy of the dataset while it runs, outsidemaxmemory; because evictions are not logged to the AOF, that copy can also hold keys the live store has evicted (as a restart would). It is refused, leaving the AOF untouched, while the dataset holds bloom filters or search indexes, which commands cannot recreate.INFOreportsaof_rewrite_in_progress,aof_rewrites,aof_last_rewrite_timeandaof_last_bgrewrite_status;METRICSreportszedis_aof_rewrites_total. -
Real observability:
INFOnow reports live command, connection, keyspace
hit/miss, expiry, eviction, network, memory, CPU, and AOF counters; new
INFO commandstats;SLOWLOG GET|LEN|RESET;LATENCY LATEST|HISTORY|RESET|DOCTOR;
andMETRICSfor Prometheus text scraping. -
slowlog-log-slower-than,slowlog-max-len,latency-monitor-threshold,
andcommand-timeout-msconfig keys, all mutable withCONFIG SET. -
Graceful shutdown on
SIGINT/SIGTERMandSHUTDOWN [NOSAVE|SAVE]. The
accept loops stop, clients are woken, and the AOF writer drains and fsyncs
before the process exits. -
CONFIG REWRITEpersists mutable directives to the config file using an
atomic temp-file rename, preserving comments and unrelated lines. -
Read-only
O(N)commands (KEYS,SCAN,LRANGE) accept a cooperative
deadline and reply-TIMEOUTinstead of stalling without bound.SCAN
remains theKEYSreplacement; the timeout bounds a stall rather than
removing it. -
TLS listener via OpenSSL:
tls-port,tls-cert-file,tls-key-file,tls-ca-cert-file,tls-auth-clients(yes/no/optional) andtls-protocols. TLS can run alongside plaintext or replace it withport 0; mutual TLS verifies client certificates against the configured CA. OpenSSL is linked statically by default. -
RESP3 support, negotiated per connection with
HELLO [2|3] [AUTH default <password>] [SETNAME name]. Connections stay on RESP2 until a client sendsHELLO 3. Under RESP3, missing values reply with the null type (_), floats with the double type (,), andCONFIG GETandBF.INFOwith a map (%). Pub/sub deliveries andSUBSCRIBE/UNSUBSCRIBEreplies are push messages (>), while RESP2 subscribers on the same channel keep receiving arrays.
Changed
- Startup no longer carries on after a failed AOF load. A damaged or unreplayable AOF now stops the server with an error instead of serving a partial dataset and appending to the bad file.
aof-load-truncated(defaultyes) lets it cut off a final command left half-written by a crash, andaof-load-brokenwithaof-load-broken-max-sizelets it discard a small corrupt tail; the cut is applied to the file so later writes append to a valid log. Any other corruption, or a command this build does not know, still stops startup. - The AOF is now loaded before its writer opens, since the writer begins appending at the file's length.
Fixed
- A float reply longer than 32 characters (for example a time-series sample of
1e300) overflowed a fixed buffer: a panic in safe builds, truncated output inReleaseFast.
Install
Linux (x86_64)
curl -Lo zedis https://github.com/charlesfonseca/zedis/releases/download/v0.2.2/zedis-v0.2.2-linux-x86_64
chmod +x zedis && sudo mv zedis /usr/local/bin/Linux (ARM64)
curl -Lo zedis https://github.com/charlesfonseca/zedis/releases/download/v0.2.2/zedis-v0.2.2-linux-aarch64
chmod +x zedis && sudo mv zedis /usr/local/bin/Verify checksums
sha256sum -c SHA256SUMSQuick start
# Start server (listens on 127.0.0.1:6379 by default)
zedis
# Connect
redis-cli ping
# PONG
SET hello world
GET hello
# "world"