Skip to content

Unit 3b follow-up: the hot store file never shrinks after a truncate #176

Description

@mairas

deleteThrough is a plain DELETE, the store is opened without auto_vacuum (which has to be set before the tables exist), and nothing ever VACUUMs. Freed pages go to the freelist and the file keeps its high-water mark for the life of the device.

In steady state that is correct — the pages are reused. After any episode that lets the store grow, the device carries that peak as permanently occupied disk even once rolling recovers, on a machine with roughly 1.4 GB free.

Deferred from signalk-parquet-history-provider#13 because PRAGMA auto_vacuum = INCREMENTAL must be set before the tables exist, so adopting it means a LAYOUT_VERSION bump — and this build refuses a store it did not write, which would discard whatever is on a device at upgrade time. Options worth weighing: incremental auto-vacuum behind a layout bump with a migration, an occasional VACUUM INTO swap, or simply reporting the file size and leaving it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions