Repository navigation
v4.3.0
Nuthatch 4.3.0 fixes the remaining ways Burrmill could run out of memory or refuse under a budget.
On the Lodestar allocations nest's real query set, the peak drops from as much as 3.3 GiB to under
1.9 GiB, and p99 drops from about 4 s to about 2.1 s. Mounting, unmounting and upgrading no longer
race the store's file lock. It is a minor rather than a patch because one answer and one metric
label change; both are listed first.
What answers differently
x % -1, wherexis the least value of a signed integer type, refuses with "Overflow in
division" as DuckDB does. 4.2 answered 0. This holds forTINYINT,SMALLINT,INTEGERand
BIGINT.HUGEINTcannot hold its type's least value and refuses it at the cast, as before.
% 0is stillNULL.- An
/sqlrefusal for running out of memory is counted as
nuthatch_sql_rejections_total{reason="out_of_memory"}. Until now it was counted under
reason="invalid", alongside a caller's typo. The caller still gets a 400.
Memory under a budget
These are Burrmill changes. Each is measured against the same input as plain text, and each landed
with the test that was missing.
- String columns are compacted where a Parquet scan produces them. A hash repartition or a sort
takes plain text rather than views, because those operators charged a 1 MiB buffer for every
small batch. - A window charges the input it holds to the pool. A cross join's output is coalesced, and its
collected side is compacted. A window over a cross join could hold about 2 GiB that the pool
never saw. It now holds about 100 MiB of the same data, and refuses when it would not fit. - A sort gathers its input into larger batches before it holds it, so a sort too large for memory
spills and answers. Since 4.1.1, such a sort could fill the pool with tiny batches and refuse
without writing a byte.
Measured with the new release gate, four 3-pass runs on Linux under the allocations nest's
production settings:
| Version | Answered | Peak RSS | p99 |
|---|---|---|---|
| 4.2.1 | 74 of 74 | 3,324 MiB | 3,995 ms |
| 4.3.0 | 74 of 74 in every run | 1,619 to 1,815 MiB | 2,086 to 2,202 ms |
Mounts, unmounts and upgrades
- Stopping a nest, through unmount, suspend, a move or shutdown, returns only once its store is
closed. Before, a remount straight after an unmount or suspend could fail with "Database already
open", because a request in flight or an alert delivery still held the file. - A refused or failed mount releases its store before it returns, so retrying at once works. A mount
whose prepare step failed used to leave its alert worker running, which held the store until the
process exited. - A hot upgrade waits for any window commit still in flight before it reads the old head. Before, a
client could see the served head step back by up to one window across the flip.
Operations
deploy-nest.sh roll <unit> <version> --smoke <file>runs each statement in the file against the
unit's/sqlafter the version check. On any refusal, out-of-memory or HTTP error it puts the unit
back on its previous binary.scripts/smoke/graph-allocations-nest.sqlis the allocations nest's
file.- The release gate (
scripts/release-gate.sh,docs/release-gate.md) serves a copy of the
allocations nest under production's settings and runs the statements Lodestar and kittiwake send
it. It fails on a refusal, a time regression, or a peak over the 2 GiB budget. It runs on the
ThinkPad for every release, and posts a commit status that does not block the tag. deploy/monitoringholds the Prometheus, Alertmanager and Grafana configuration for the production
nests. It includes the nine documented alerts and alerts for refusals and out-of-memory.- A weekly workflow times
init,devand a first query against mainnet with the published binary. nuthatch doctorno longer reads an endpoint whose URL contains "429", "plan" or "upgrade" as
rate-limited.
Compatibility and upgrade
Replace the binary and restart. There is no storage migration, configuration change or re-index.
A dashboard or alert that counted out-of-memory refusals under reason="invalid" should read
reason="out_of_memory".