Skip to content

feat(storage): reclaim free runtime SQLite pages in Host maintenance - #6083

Draft
garvit-arora wants to merge 2 commits into
apache:mainfrom
garvit-arora:feat/6000-runtime-reclaim
Draft

garvit-arora wants to merge 2 commits into
apache:mainfrom
garvit-arora:feat/6000-runtime-reclaim

Conversation

@garvit-arora

@garvit-arora garvit-arora commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a bounded Host maintenance lane that returns free pages from new runtime.sqlite databases initialized with auto_vacuum = INCREMENTAL by #6044. Each tick reads auto_vacuum and freelist_count in a read transaction, skips older NONE files without a write lock, runs at most 64 pages of incremental_vacuum through the process-local operational database owner, and follows a productive commit with a PASSIVE checkpoint. The lane uses the existing 100 ms active and 60 s idle cadence and drains with Host maintenance.

Existing NONE databases remain report-only. This PR does not convert them, add another SQLite owner connection, or change protocol, UI, or compatibility epoch.

Refs #6000

Verification

  • Core, storage, MCP, runtime, and Runtime Host builds passed on the initial rebased head; storage and Runtime Host builds passed again after adding the tests.
  • Focused storage and Host maintenance tests: 10 passed. They cover the 64-page limit, draining an incremental database, preserving an existing NONE database and its freelist, invalid limits, and Host lane scheduling.
  • Biome lint and format passed on the changed test files; git diff --check passed.
  • Full PR CI is pending on the latest head.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex helped implement and review the storage and maintenance lane and its focused tests.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — new incremental runtime databases can reclaim free pages in Host maintenance.
  • No

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

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant