Skip to content

Data retention is effectively non-functional; DB grows unbounded (1.2 GB+) #7

Description

@pgianotto

A user's DB reached 1.2 GB. Retention has three gaps:

  1. "Automatic Archiving" never runs. enableAutoArchive/retentionDays are saved and shown (content.php:334, api.php:1521/1570) and advancedStatsArchiveOldData() exists (api.php:877), but nothing invokes it — no cron, systemd timer, FPP scheduler entry, or call in scripts/postStart.sh. Only the manual "Archive Old Data Now" button calls it (content.php:569).
  2. Archive skips the biggest tables. $tables_to_clean (api.php:929) lists only sequence_history, playlist_history, gpio_events, daily_stats — command_history and command_preset_history are never pruned even manually.
  3. File never shrinks. VACUUM runs only inside the daily_stats branch of the archive (api.php:978) and only when daily_stats had expired rows; advancedStatsEmptyDatabase() (api.php:749) never VACUUMs. After a big DELETE the file stays its old size.

Suggested: run the retention job on a schedule when enableAutoArchive=1 (respecting retentionDays, -1 = keep all); include the command tables; always VACUUM (or PRAGMA incremental_vacuum) after deletes and after Empty Database.

Related: GPIO event volume and command-table bloat are filed separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions