Repository navigation
v1.2.1 #651
murtazayusuf
announced in
Announcements
v1.2.1
#651
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
KiviDB v1.2.1
KiviDB 1.2.1 is out. It is a patch release of 1.2.0: it fixes the reshards that could lose writes, replicas that could stop while saving, and two security issues (GHSA-cg4w-p5w5-57w5, high, and GHSA-qh83-449g-hwm5, medium) that affect 1.2.0 and 1.1.x. Please upgrade.
kividb/kividb:v1.2.1andghcr.io/kividbio/kividb:v1.2.1(1.2andlatesttoo).apt install kividb/dnf install kividb, with updates through your normal system upgrades. Setup in docs/INSTALL.md.cargo install --locked kividb(crates.io).brew install kividbio/tap/kividb.What's in 1.2.1
1.2.1 is a patch release of 1.2.0. It fixes the 1.2.0 known issues of reshards that could lose writes and replicas that could stop while they saved, and many smaller ways in which a replica, the append-only file or a reshard could end up with other data than the master:
MIGRATE(redis-cli --cluster reshard) or withCLUSTER MIGRATION IMPORT(the Kubernetes operator): a write checks inside the write gate whether its keys have left the node, and is sent on with-ASKor-MOVEDif they have. The same holds forEXECand scripts, and for every other way a slot leaves a node (MIGRATE: a write routed before its key moved can run after it, at the source (lost writes during a reshard) #331, Cluster: a write held across a slot loss learned from gossip, a failover or DELSLOTS can still run on the old owner (#331 follow-up) #337, Cluster: EXEC during slot migration: partial ASK replies, no-writes scripts refused, stale fast-path check #339, Cluster: GEORADIUS … STORE inside EXEC isn't treated as a write during a slot handoff, so its write can be lost #407).CLUSTER MIGRATION IMPORTloses acknowledged writes #516).MIGRATEno longer stopsredis-cli --cluster reshardwithTRYAGAINfor an unchanged hash whose field is about to expire (MIGRATE: a spurious TRYAGAIN for a hash whose field expires within ~2 ms of the check #332).CLUSTER FLUSHSLOTS,ADDSLOTS,ADDSLOTSRANGE,BUMPEPOCH,SET-CONFIG-EPOCH,COUNT-FAILURE-REPORTS,GETKEYSINSLOT) answer as in Redis (CLUSTER FLUSHSLOTS clears other nodes' slots too and doesn't require an empty database #552, CLUSTER ADDSLOTS/ADDSLOTSRANGE failing part-way keep earlier slots claimed but skip the nodes.conf save and state refresh #553, Cluster admin commands differ from Redis: GETKEYSINSLOT 0, SET-CONFIG-EPOCH, COUNT-FAILURE-REPORTS, shard id, BUMPEPOCH, standalone replies #563), and a restarted node gives its own address at once (After a cluster master restarts, CLUSTER SLOTS reports its address as '?' for several seconds #307).CLIENT PAUSE ... WRITEreplies only once every write already being applied is in the offset, so a switchover (the operator's, and any that works the same way) no longer promotes a replica without the last acknowledged write (CLIENT PAUSE WRITE replies before writes in flight finish, so a switchover can lose an acknowledged write #629).UNLINKon, so a replica no longer keeps a key the master no longer has (PERSIST on a key past its time answers 0 but is still propagated, and a replica makes the key persistent #628). A write that changed nothing is no longer sent on, as in Redis.HDEL(Hash-field expiry: each server expires fields by its own clock, so replicas and AOF replays end up with different data #415). Its deadline is kept to the millisecond everywhere, and a replica holds the master's (A hash-field deadline can move by 1 ms through MIGRATE / DUMP-RESTORE (Instant <-> Unix ms conversion) #594, Relative hash-field TTLs are sent to replicas up to 1 ms earlier than the master's own deadline #489). A relative TTL reaches replicas and the AOF as the master's own deadline (RESTORE with a relative TTL can reach replicas and the AOF 1 ms off the master's deadline #602).JSON.MSET,XGROUP CREATE ... MKSTREAM,TS.ADD) (Replica/AOF divergence: a JSON.MSET that fails part-way keeps its earlier writes on the master but propagates nothing #551),SPOPwith a count from a RESP3 client is replicated, and a write in database 0 no longer reaches replicas and the AOF in another database (Replication/AOF: a db-0 write in flight when a client first selects another database can be applied in that database #423).--io-model tokio,CLIENT KILLends a replication link (CLIENT KILL does not drop a replica's link on the tokio loop; replica links are not flagged S #595).WAITandWAITAOFno longer starve socket I/O on io_uring (io_uring: prevent WAIT from starving replica I/O #498).replica-priority 0, and new--replica-priorityand--replica-announcedflags set them (replica-priority 0 is accepted but ignored: INFO still reports slave_priority:100 #443).appendfsync alwayssyncs each write to disk before it is acknowledged, as in Redis (appendfsync always may sync the AOF only once a second (needs verification) #513). It was accepted and did nothing.CONFIG SET appendonly yesstarts a new log instead of appending to an old one (AOF turned on at runtime appends to a leftover appendonly.aof, so a crash during the enable can replay stale writes #350, AOF recovery deletes .prev after an AOF-off save over a stopped turn-over, losing acknowledged writes #368, AOF: follow-ups from #352 (dir sync between the gen and dump renames, stale mark after downgrade, partial kept copies, docs) #359). A log that is not replayed is never deleted: it is kept aside indirassuperseded.<time>.<n>.appendonly.aof, and counted inINFO persistence(aof_superseded_files,aof_superseded_bytes).appendonly no, noappendonly.aofis made or needed (An empty appendonly.aof is created, and must be writable, even with appendonly no #47)..dfsfile, databases the server does not have) is refused instead of loaded in part (--preload-file rdb: of a non-RDB file (Dragonfly .dfs) starts an empty server with no error #444, dump.kdb cut inside its trailing sections still loads without TTLs, functions or indexes #474, RDB loader puts every database number of 16 or more into database 0 without a warning #477, dump.kdb, a KDB full sync or an AOF preamble from a server with more databases loses the extra databases without a warning #482).INFOno longer stalls writes on a server with many keys that have a TTL: about 0.1 ms with 5 million of them, against 55 ms (INFO keyspace scans every TTL entry, causing ~40 ms requests and SET tail-latency spikes at 5M TTL keys #622).HSETno longer takes a lock every worker shares when no search index is defined (HSET overwriting a field of a hash without field TTLs is ~9% slower at pipeline 16 than in 1.2.0 #544).ZREM,ZCOUNTandZREMRANGEBYSCOREno longer scan the whole sorted set (perf(zset): ZREM performs O(N) scan for each removed member #386, perf(zset): ZCOUNT and ZREMRANGEBYSCORE scan entire sorted sets #408).dump.rdb,--preload-file, a full sync from a Valkey 9 primary andRESTOREof itsDUMPpayloads (Valkey 9.0/9.1 data cannot be read (RDB version 80, VALKEY080 header) #449). Dragonfly's hashes with field TTLs and JSON documents, KeyDB's field TTLs andDUMPpayloads, and Redis Stack 6.2's files load; what KiviDB does not read is refused by name (Dragonfly member-expiry types and KeyDB extensions don't load #452). An RDB file's databases past 15 load into their own databases (RDB loader puts every database number of 16 or more into database 0 without a warning #477).KEYSandSCANpatterns and passwords (Redis compat: Binary (non-UTF-8) keys rejected: "ERR key must be valid UTF-8" #437, Startup load accepts non-UTF-8 key names that SET and RESTORE refuse #446).HELLOreports the Redis release KiviDB follows (server: redis,version: 8.10.0), so redis-py and Jedis turn on their client-side caches (redis-py and Jedis refuse their client-side caching against KiviDB (version check for Redis 7.4+) #451).BRPOPLPUSHandBLMOVEtime out with*-1(BRPOPLPUSH and BLMOVE time out with a null bulk ($-1) in RESP2; Redis replies with a null array (*-1) #385).falseis a RESP3 null to a RESP3 client, so Celery chords complete with redis-py 8 (Lua: a script's false is sent as $-1 to RESP3 clients (Redis: _); redis-py 8 fails with "Protocol Error", Celery 5.7 chords never complete #431).@connectionholds what it holds in Redis, so redis-py's cluster client connects with+@connection(ACL: @connection lacks COMMAND, SELECT, READONLY, READWRITE, ASKING, WAIT, WAITAOF; redis-py cluster clients get NOPERM #392).MULTI,WATCH,HELLO, the ACL log,TTLrounding, expire-time bounds, blocking commands in scripts,SWAPDB,DEBUG, cluster, JSON, search and time series commands answer as Redis, RedisJSON, RediSearch and RedisTimeSeries do. JSON numbers keep every digit (JSON numbers that need 17 significant digits lose the last one #445).https://packages.kividb.io, foramd64andarm64:apt install kividbanddnf install kividb. See docs/INSTALL.md..deband.rpmsay they need glibc 2.34.cargo install --locked kividb, orcargo binstall kividb.X.Y.Z-src, and source archives are small again.CHANGELOG.md has the full list.
Security
1.2.1 fixes two issues; upgrade from any 1.1.x or 1.2.0.
GEORADIUS/GEORADIUSBYMEMBER ... STORE|STOREDISTandMIGRATEwere let through by read-only key permissions such as%R~*.+@readgranted them, and-@writedidn't remove them or theFUNCTION LOAD|DELETE|FLUSH|RESTOREsubcommands.min-replicas-to-write, the out-of-memory refusal andaof-ack-after-writedidn't apply to them.NOPERM,NOREPLICASorOOM, as in Redis.JSON.SETat ever deeper paths could build a document thousands of levels deep. Reading or copying it then overflowed the stack and stopped the process.ERR recursion limit exceeded, as RedisJSON does.RESTOREpayloads holding such a document, or an array index past the largest allowed, are refused.Before you upgrade
RESTORE, soMIGRATEto it fails and the source keeps the key.HDEL; a replica hides it from its readers meanwhile.HDELfor the fields that expired. RunBGREWRITEAOFonce after upgrading.SORTwhoseBYorGETpattern reads a hash field now runs alone, as a script does.WAITwith no replicas waits out its timeout, as Redis does:WAIT n timeoutwithnabove 0 answered at once, and now answers 0 aftertimeout.WAITis refused on a replica, and a negative timeout is refused.WAIT 0answers the number of replicas that have what was written, not the number connected.HELLOsaysserver: redisandversion: 8.10.0. A tool that told KiviDB apart byHELLO'sservershould look forkividb_versioninstead, as inINFO.GEORADIUSandGEORADIUSBYMEMBERare refused on a read-only replica, with or withoutSTORE, as in Redis. An application that reads from replicas with them must switch toGEORADIUS_ROandGEORADIUSBYMEMBER_RO, orGEOSEARCH.+@writebut not+@connection(or+@all) can no longerSELECT. Add+select.+@read,+@keyspaceor+@genericbut not+@connectioncan no longer runWAITorWAITAOF. Add+wait +waitaof.+@all -@write, or of thereadonlyshorthand, may nowSELECT.ACL LOGanswers as Redis does: fields in Redis's order,entry-id(notid) counting from 0, and the ten newest entries without a count. A client that reads entries by position or byidneeds to change.acllog-max-len(default 128) is now applied.CONFIG REWRITEneeds a config file. A server started without one now repliesERR The server is running without a config file. To use it in the Docker image, start the server with--configfilepointing at a file that exists. On a host where an earlier version created/etc/kividb/kividb.confthis way, look for areplicaofline nobody wrote, and delete or fix it.RESTOREor snapshot) won't start on 1.2.1 if the key is in its snapshot or AOF preamble.ZRANGE key 0 -1 WITHSCORESshowsnan.FT._LISTlists the selected database's indexes, and the commands that name an index of another database replyIndex not found. AnFT.ALTER,FT.ALIASADD,FT.ALIASDEL,FT.ALIASUPDATEorFT.SYNUPDATEthat a 1.2.0 AOF or master holds for another database's index is refused on replay. Once the master is upgraded, check such an index withFT.INFOfrom its own database and repeat what is missing.DUMP,RESTOREandMIGRATEleave out a series' compaction rules and source, as in RedisTimeSeries. An atomic slot migration from a 1.2.0 node, as in a rolling upgrade, loses the moved series' rules: make them again withTS.CREATERULEafterwards.CHUNK_SIZE), and a word that is not an option no longer drops the options after it. A 1.2.0 AOF replays whole, under these rules, so after the first restart a series can differ from what 1.2.0 held in memory.i64::MAXis refused.JSON.NUMINCRBYandJSON.NUMMULTBYkeep a float result a float (1.5 + 1.5is3.0), and refuse an integer overflow withERR numeric overflow. A client that reads such a result as an integer may need to change.i64::MAXmilliseconds isERR invalid expire time, a number too large isERR value is not an integer or out of range,EXAT 0andPXAT 0are refused, andSETwithKEEPTTLand a time, or with two ofEX,PX,EXATandPXAT, is a syntax error. A hash field's deadline must be from 0 to 2^46 - 1 ms after the epoch.TTLandEXPIRETIMEround to the nearest second.MULTI,UNWATCH,AUTH,HELLO,MONITOR,WAITandWAITAOFare queued, as in Redis 8.MONITORis refused there, andWAITandWAITAOFanswer at once.appendfsync alwaysnow costs writes a second, as in Redis.everysecstays the default.CLIENT PAUSEcan answer an error (writes in progress did not finish before the pause could take hold) when a write being applied takes longer than 5 seconds, and then pauses nothing.CLUSTER FAILOVERon a replica of the source repliesOKbut does not happen. The source and the replica log why. Ask again a few seconds later.CLIENT LISTshowflags=Son the master andflags=Mon the replica, andconnected_clientsno longer counts them.Known issues
MEMORY PURGE, as in 1.2.0.redis-cli --cluster reshardunder heavy writes slows the source node's writes to seconds (#310), as in 1.2.0. No write is lost.CLUSTER MIGRATION IMPORT, which the Kubernetes operator uses, isn't affected.Benchmarks
benchmarks/1.2.1 measures 1.2.1 against the 1.2.0 release binary, with the 1.2.0 suites' method and harnesses: throughput and latency by data type, memory per key, instructions per command, vector search, and memory during a snapshot. benchmarks/1.2.0 has the comparison with other servers.
Thanks
Thanks to the contributors whose work is in this release:
@Parikalp-Bhardwaj (hash fields expired by the master,
MEMORY USAGEof sets, hashes and sorted sets,ZREM,ZCOUNTandZREMRANGEBYSCOREwithout a scan, active defrag's relocation made safe against a panic, and a test ofPFMERGEandPFADD),@Ayege (
JSON.NUMINCRBYandJSON.NUMMULTBYfloats and overflow),@matheussilvano (
SCRIPT HELP,latency-tracking-info-percentiles,INFO commandstats, and the LangChain, LangGraph, LlamaIndex and Mem0 harnesses),@paddor (
WAITandWAITAOFon io_uring),@Sourabh-ctrl (
SCOREandSCORE_FIELDas in Redis),@saikishore222 (
DEBUG),@bfs2021 (the eviction tests), @ZYZ666-RGB (the LlamaIndex harness) and @Anandb71 (the chat compatibility checks).
All reactions