Skip to content

v0.2.2

Latest

Choose a tag to compare

@github-actions github-actions released this 10 Nov 16:29
· 1 commit to main since this release
Immutable release. Only release title and notes can be modified.

Added

  • AOF rewrite on a background thread: BGREWRITEAOF and 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 with PING latency unchanged. It needs memory for a second copy of the dataset while it runs, outside maxmemory; 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. INFO reports aof_rewrite_in_progress, aof_rewrites, aof_last_rewrite_time and aof_last_bgrewrite_status; METRICS reports zedis_aof_rewrites_total.

  • Real observability: INFO now 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;
    and METRICS for Prometheus text scraping.

  • slowlog-log-slower-than, slowlog-max-len, latency-monitor-threshold,
    and command-timeout-ms config keys, all mutable with CONFIG SET.

  • Graceful shutdown on SIGINT/SIGTERM and SHUTDOWN [NOSAVE|SAVE]. The
    accept loops stop, clients are woken, and the AOF writer drains and fsyncs
    before the process exits.

  • CONFIG REWRITE persists 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 -TIMEOUT instead of stalling without bound. SCAN
    remains the KEYS replacement; 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) and tls-protocols. TLS can run alongside plaintext or replace it with port 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 sends HELLO 3. Under RESP3, missing values reply with the null type (_), floats with the double type (,), and CONFIG GET and BF.INFO with a map (%). Pub/sub deliveries and SUBSCRIBE/UNSUBSCRIBE replies 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 (default yes) lets it cut off a final command left half-written by a crash, and aof-load-broken with aof-load-broken-max-size lets 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 in ReleaseFast.

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 SHA256SUMS

Quick start

# Start server (listens on 127.0.0.1:6379 by default)
zedis

# Connect
redis-cli ping
# PONG

SET hello world
GET hello
# "world"