Skip to content

kv: add --forgotten, a transaction held open through the tpcc window, and the throughput of each ten seconds - #279

Merged
tamnd merged 1 commit into
mainfrom
ch-forgotten
Oct 9, 2026
Merged

tamnd merged 1 commit into
mainfrom
ch-forgotten

Conversation

@tamnd

@tamnd tamnd commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Part of tamnd/rudb#1390 (W7), the run with a deliberately forgotten open transaction that decides question 5 of engine-v4/19-open-questions.md.

Question 5 asks what happens when undo is over its share. Under option a writers wait, and a forgotten open transaction stops every writer in the database. Under option b, which rudb built at W6 (the undo spill of tamnd/rudb#1389), the collector spills the oldest undo and, at max_temp_directory_size, aborts the oldest snapshot, and throughput should not move. The driver had no way to leave a transaction open, and it reported throughput only per second, too fine to read a slow fall over a long window.

--forgotten (tpcc mode only) opens one more session. As the measured window opens it begins a read transaction with Session::begin_snapshot, runs SELECT count(*) FROM warehouse once so it holds a snapshot, and then does nothing until the window ends, when it rolls back. It runs beside the terminals and, if asked, the --analytic streams.

The report adds forgotten held_s= every_s=10 tx_per_s=a,b,c,..., the mean transactions a second over each ten seconds of the window, the last span perhaps shorter. Under option a the list should fall to zero after a bounded time. If the begin, the read or the rollback fails it prints forgotten error= and the run gets the verdict forgotten_failed.

The window has to be long enough for undo to pass its share. For example rudb-bench-kv --mode tpcc --backend rudb --target t.db --load --warehouses 2 --terminals 4 --analytic 2 --forgotten --warmup 30s --window 1800s.

The driver only shows throughput. Undo resident, spill bytes and a snapshot too old abort come from rudb's own metrics, and the share size the question also asks about needs runs at several memory_limit settings.

Tests

  • main.rs: --forgotten parses in the tpcc mode and is refused in --mode ch.
  • tpcc.rs: the ten second timeline is the mean of each span, the last may be short, and an empty run gives an empty list.
  • A run on server3 against rudb: results to follow in a comment.

@tamnd tamnd added kind/feature It should do something it does not. area/tpc TPC-H and TPC-DS. labels Oct 9, 2026
@tamnd
tamnd merged commit 55a5bb0 into main Oct 9, 2026
1 check failed
@tamnd
tamnd deleted the ch-forgotten branch October 9, 2026 12:56
@tamnd tamnd mentioned this pull request Oct 12, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tpc TPC-H and TPC-DS. kind/feature It should do something it does not.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant