Repository navigation
feat(config): let the engine control SystemConfig defaults - #77
Conversation
Stop pinning a copy of every engine default in this binding. All engine settings now default to None, and only explicitly set values are forwarded to either backend (capi starts from lbug_default_system_config(), pybind from SystemConfig()). Unset settings now follow engine-side default changes automatically. BREAKING CHANGE: Database() settings parameters changed from concrete defaults (e.g. enable_multi_writes=False) to None meaning "engine default"; explicitly passed values behave as before.
The binding no longer pins throw_on_wal_replay_failure=True; unset settings follow the engine default (false: silently ignore). This test verifies that a checksum mismatch raises, so it must now opt into throwing explicitly.
|
CI failure addressed: |
|
There is also a question of not changing the defaults on our largest user base (python). Should the engine also switch to |
|
I'd keep the engine on
The problem is that
DuckDB's rule fits our WAL framing: drop only a record that runs past EOF, or a bad last record with nothing valid after it, and throw on everything else whatever the flag. I can open that as a draft under LadybugDB/ladybug#1376. After it, all Python users notice from the new WAL default is that a crash-torn database opens. Until then, LadybugDB/ladybug#1358 should land first: the test edit here and the |
|
Agree on keeping the engine on On order:
The BREAKING CHANGE note covers reads returning |
|
Agreed on the order, and on not holding Python back for the narrowing. It should still ship in the release that carries this PR. A lenient build without it truncates the WAL at the first record type it doesn't know and drops every commit after it: 0.22.1 opened with Once this PR carries #75's torn-tail test and docstring I'll close #75, and One correction to my comment above: DuckDB drops only an entry that runs past EOF. Dropping a bad last record with nothing valid after it is my addition, for the tails a power loss can leave. |
Bring over the torn-tail test and replay docstring from Refs #75, adapted to engine-controlled defaults: a strict open still throws on the torn tail while the default open keeps the first insert. The docstring now says recovery replays up to the last complete commit and truncates there, dropping the torn tail and anything after a damaged record.
The engine build CI uses now carries the checksum-mismatch fix, so a checksum-setting mismatch throws even on the lenient default. Drop the temporary explicit throw_on_wal_replay_failure opt-in; the test now covers the new default.
Follow-up to #76 (which simply flipped the default): instead of pinning a copy of every engine default in this binding, all engine settings now default to
None, and only explicitly set values are forwarded to either backend.database.py: settings params default toNone; new_engine_kwargs()forwards only set values to both backends._lbug_capi.py: params default toNone; applies only set values ontolbug_default_system_config().py_database.cpp/py_database.h: constructor takesstd::optionalparams (defaultpy::none()) applied ontoSystemConfig().Unset settings now follow engine-side default changes automatically (e.g. LadybugDB/ladybug#1435's
enable_multi_writesflip needs no binding change). Explicitly passed values behave exactly as before, so existing code passing values is unaffected.Supersedes #75: carries its torn-tail test (
test_database_opens_past_a_torn_wal_tail_by_default) and replay docstring. The checksums test now exercises the new lenient default against an engine build carrying LadybugDB/ladybug#1358 (mismatch throws in both modes). Fixes #74.BREAKING CHANGE: settings parameters changed from concrete defaults to
None= "engine default". Code that only readsdb.enable_multi_writesetc. may now seeNoneinstead of the old hardcoded value. A database whose WAL a crash tore now opens by default, without the interrupted transaction, instead of throwing.