Skip to content

fix(compaction): bound merge batch and log memory breakdown on OOM (11.0.251)#799

Merged
adubovikov merged 1 commit into
homer11from
fix/compaction-oom-bounded-merge
Jun 12, 2026
Merged

fix(compaction): bound merge batch and log memory breakdown on OOM (11.0.251)#799
adubovikov merged 1 commit into
homer11from
fix/compaction-oom-bounded-merge

Conversation

@adubovikov

Copy link
Copy Markdown
Member

Summary

Follow-up to #798: CompactionService: merge_adjacent_files still OOMs on a 2GB-capped writer (could not allocate block of size 256.0 KiB (1.8 GiB/1.8 GiB used)).

Unbounded ducklake_merge_adjacent_files rewrites every small parquet of a table in one CALL; that working set alone can exhaust memory_limit while search and flush share the same DuckDB instance.

Changes

Test plan

  • go build ./..., go vet, go test ./writer/ — pass
  • Deploy, wait for a compaction cycle: merge_adjacent_files completed instead of OOM
  • If OOM persists, the new duckdb memory breakdown WRN lines identify the holder

merge_adjacent_files with no max_compacted_files rewrites every small
parquet of a table in one CALL; on a 2GB-capped writer that working set
alone exhausts memory_limit while search and flush share the instance.

- Default max_compacted_files to 100 when the operator left it 0;
  leftovers are merged on subsequent cycles.
- On Out of Memory during merge, dump duckdb_memory() so operators can
  see who holds the budget and whether disk spilling is engaged
  (temporary_storage_bytes > 0 proves temp_directory works).

Bump VERSION_APPLICATION to 11.0.251.
@adubovikov adubovikov merged commit 07675ce into homer11 Jun 12, 2026
10 checks passed
@adubovikov adubovikov deleted the fix/compaction-oom-bounded-merge branch June 12, 2026 21:01
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.

1 participant