Skip to content

feat(config): rename debug_enable_multi_writes to enable_multi_writes, default to true - #1435

Open
adsharma wants to merge 1 commit into
mainfrom
rename-enable-multi-writes
Open

adsharma wants to merge 1 commit into
mainfrom
rename-enable-multi-writes

Conversation

@adsharma

@adsharma adsharma commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Concurrent write transactions are production-ready, so the debug_ prefix has to go.

What changed

  • Setting renamed: debug_enable_multi_writes -> enable_multi_writes (consistent with SystemConfig::enableMultiWrites and the other enable_* settings).
  • C++ struct renamed: EnableMVCCSetting -> EnableMultiWritesSetting; dropped the stale TODO calling it a temporary test solution.
  • Default flipped from false to true in SystemConfig.
  • Updated all CALL sites (e2e .test files, transaction_test.cpp, checkpoint_test.cpp, node_write_bench.cpp).
  • ddl_serial_execution.test MultiWritesException case now opts out explicitly with CALL enable_multi_writes=false so single-writer mode stays covered; the EnableMultiWrites case now exercises the false->true toggle.

Verified locally

  • ninja -C build/release lbug builds clean.
  • e2e concurrency suites pass (27 tests): ddl_serial, ddl_concurrent, dml_empty_serial, dml_tinysnb_serial.

Companion binding PRs

Each binding now lets the engine control defaults (unset = engine default), so no binding pins a copy of these defaults anymore:

@adsharma

Copy link
Copy Markdown
Contributor Author

Note: this is 0.23.x material — it flips a user-visible default (multi-writer mode on by default) and renames a setting, so it should ride the 0.23 release, not get backported to a 0.22.x patch.

@adsharma

Copy link
Copy Markdown
Contributor Author

Companion binding PRs (same default flip, separate repos since these are submodules here): ladybug-python#76, ladybug-java#17, ladybug-rust#44. nodejs/wasm don't expose the flag, so no change needed there. CI on this PR covers the engine side.

@adsharma

Copy link
Copy Markdown
Contributor Author

Update: superseded the default-flip-only binding PRs with fuller ones where each binding lets the engine control all defaults (unset = engine default): ladybug-python#77, ladybug-java#18, ladybug-rust#45, plus nodejs#28 and wasm#14 which needed the same treatment. CI here covers the engine side; each binding repo's CI covers its own.

@adsharma adsharma changed the title feat(transaction): rename debug_enable_multi_writes to enable_multi_writes, default to true feat(config): rename debug_enable_multi_writes to enable_multi_writes, default to true Oct 27, 2026
@zahariash

Copy link
Copy Markdown
Contributor

I checked this against the open PRs under #1376, simulating the new default on their merge.

Automatic checkpoints wait for other writers. A commit's automatic checkpoint takes the write gate and waits up to 5 s for every other write transaction to leave. In single-writer mode none can be open at that point. Here, one connection held a write transaction open while another committed three single-row writes, with checkpoint_threshold=1:

Each write Caller sees
0.22.0, single-writer 0 s "Only one write transaction at a time" (nothing applied)
0.22.0, multi-writer 5.6 s "Transaction committed successfully, but the post-commit checkpoint failed" (#1199)
#1376 merge, multi-writer 5.6 s success, and a stderr warning per commit

With the 16 MB default this starts once the WAL passes the threshold and repeats on every commit while a long write transaction stays open, and new writers wait behind the gate meanwhile. So #1361 should land with or before this PR; otherwise retries of those "failed" commits apply them twice. The 5 s stall stays even with #1361; an automatic checkpoint could skip, instead of waiting, while other write transactions are open.

#1375 still matters. In multi-writer mode a BEGIN is still refused when the WAL is poisoned. With one failed WAL sync injected, 0.22.0 refuses the BEGIN and the connection's next MATCH segfaults (#1316); with #1375 it answers.

Merge notes.

Apart from those, transaction_test and the whole e2e suite pass on the #1376 merge with multi-writer mode as the default. I skipped EmptyDBTransactionTest, whose concurrency tests already turn the mode on themselves.

The simulator and the retention loop behind #1436 and #1437 have only run single-writer mode so far; the C stress loop ran multi-writer mode in half of its rounds without a violation.

…rites, default to true

The debug_ prefix no longer reflects reality: concurrent write
transactions are production-ready. Rename the setting to
enable_multi_writes (matching SystemConfig::enableMultiWrites and the
other enable_* settings), rename EnableMVCCSetting to
EnableMultiWritesSetting, and flip the default from false to true.

Update all CALL sites, and make the MultiWritesException e2e case opt
out explicitly via CALL enable_multi_writes=false so it still covers
single-writer mode.
@adsharma
adsharma force-pushed the rename-enable-multi-writes branch from c2e34d6 to f7b571a Compare October 30, 2026 01:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants