Skip to content

Fix archive compaction OOM on large parquet groups#792

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/archive-oom-and-finops-compat
Apr 6, 2026
Merged

Fix archive compaction OOM on large parquet groups#792
erikdarlingdata merged 1 commit intodevfrom
fix/archive-oom-and-finops-compat

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Raise DuckDB memory cap from 2GB to 4GB
  • Create a fresh DuckDB connection per (month, table) group so memory is fully released between groups
  • For groups with >2 files, merge incrementally in pairs (smallest-first) instead of all at once

Fixes recurring hourly OOM: Failed to compact 202603/query_snapshots (4 files) — Out of Memory Error: failed to allocate data of size 480.0 MiB

Test plan

  • Verify next hourly compaction cycle succeeds for query_snapshots
  • Check logs for any new errors or intermediate file cleanup issues

🤖 Generated with Claude Code

DuckDB was running out of memory compacting monthly parquet files
(e.g., 4 query_snapshots files needing ~480MB to merge). Three changes:

- Raise DuckDB memory cap from 2GB to 4GB
- Create a fresh DuckDB connection per (month, table) group so memory
  is fully released between groups
- For groups with >2 files, merge incrementally in pairs (smallest-first)
  instead of all at once, reducing peak memory significantly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 4ab7cb0 into dev Apr 6, 2026
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