Audit of RisingWave's guarantees: what held, and two subscription gaps #28176
turbolytics
started this conversation in
General
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.
Hi RisingWave team. I audited RisingWave v3.1.2 and
main(nightly 2026-11-24, 78d0243) against its documented guarantees, running it as a distributed cluster in Docker (meta, compute, frontend and compactor each in its own container, PostgreSQL metastore). Most of it held up very well. The most serious finding is filed as #28175: writes acknowledged by FLUSH are lost when the meta node crashes. This post has the rest: what held, and two gaps in subscriptions.About my use case. I build Temper, a tool that checks systems against their documented guarantees. I used Claude Code to help build the checks and write this up. I verified each reproduction myself.
What held
BEGIN READ ONLYcompared eight views (aggregates, inner and outer joins, top-N, COUNT(DISTINCT), a dynamic filter, a view on a view) with their defining queries run as batch queries in the same snapshotrw_implicit_flushonThe checks stay away from two behaviors RisingWave documents or chose: concurrent writes to one row may lose one (#970), and a session doesn't read its own writes until a FLUSH.
Two subscription gaps
1. A change made right after
CREATE SUBSCRIPTIONreturns is not delivered. The docs say a subscription includes "the incremental change records in the table after the subscription is created". A change made in about the first second is missing, even from a cursor declared before the change.main)With no wait it fails every time on both versions: 10 of 10 reading
SINCE begin(), and 5 of 5 each with the cursor declared first and with a FLUSH betweenCREATE SUBSCRIPTIONand the write. AFULLcursor shows the row, since it reads the table's snapshot.2. Resuming the way the docs say re-delivers rows. The docs give this recipe: "I want to resume after a restart (no duplicates, no data loss): persist
rw_timestampand resume withSINCE <rw_timestamp>", and say "We also guarantee no duplicates in subscriptions, thus ensuring exactly-once delivery." ButSINCE"Starts reading from the first time point greater than or equal to the specifiedunix_msvalue", so a resumed cursor re-delivers the rows of the epoch already consumed. A consumer that followed the recipe exactly, restarting every 20-60 rows, received 26 duplicates over 21 resumes on v3.1.2 and 31 over 24 onmain. Nothing was lost, and replaying the changes gave the table's final contents.Inside one cursor this doesn't happen: after an epoch, the cursor seeks
rw_timestamp + 1(cursor_manager.rs). A consumer can't resume at+ 1either, since the rows of one statement share a timestamp and it would skip any it hadn't read. A resumable position inside an epoch, or docs that say to deduplicate the last epoch, seems to be needed.How to reproduce
For the first, in psql against a fresh cluster:
Both as one command each, from a fork pinned at
218eb9cwith Docker and Temper v0.1.9:The matrix shows every claim in the inventory of RisingWave's surface. This pass decided 45 of its 1,189 cells (3.8%).
Happy to open issues for either subscription gap, or to test a fix.
All reactions