Skip to main content

Module maintenance

Module maintenance 

Source
Expand description

Nightly metadata-database maintenance.

Two steps, in order:

  1. FTS merge — folds the many small segments a day of index writes leaves behind, and clears the tombstones the contentless index accumulates on every delete.
  2. space reclaim — checkpoints the WAL, refreshes query statistics, and rewrites the database only when enough of it is dead space to be worth the write lock.

Not per tenant. meta.db is one global file and both FTS indexes span every tenant, so a tenant loop would repeat identical whole-database work.

Structs§

DbMaintenanceTask
Meta-database maintenance. Scheduled via cron at process start, and on demand from POST /api/admin/db-maintenance.

Functions§

init
Register the maintenance task kind with the scheduler.
schedule
Schedule the nightly run.