Skip to content

Align MAX_SNAPSHOT_ENTRIES with Snapper retention (off-by-one)#6175

Open
Pegorim wants to merge 1 commit into
basecamp:quattrofrom
Pegorim:fix/snapshot-entries-off-by-one
Open

Align MAX_SNAPSHOT_ENTRIES with Snapper retention (off-by-one)#6175
Pegorim wants to merge 1 commit into
basecamp:quattrofrom
Pegorim:fix/snapshot-entries-off-by-one

Conversation

@Pegorim

@Pegorim Pegorim commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Snapper is configured with NUMBER_LIMIT="5" (default/snapper/root), but limine-snapper-sync also counts the freshly-created / currently-booted snapshot, so five retained snapshots are reported as six entries. It warns on every snapshot and every update:

limine-snapper-sync: Snapshot limit mismatch: 6 Snapper snapshots exceed configured MAX_SNAPSHOT_ENTRIES=5

(There is already migration 1782049344.sh that hides the desktop notification for this, but the underlying count mismatch and the journal warning remain.)

Fix

Raise MAX_SNAPSHOT_ENTRIES to 6 (NUMBER_LIMIT + 1) so the boot-menu cap and Snapper retention agree.

Alternative: MAX_SNAPSHOT_ENTRIES=auto derives the cap from Snapper directly and can never mismatch — happy to switch to that if you prefer it over an explicit value. I kept an explicit number here to preserve the existing boot-menu limit. Note NUMBER_LIMIT_IMPORTANT="5" is separate, so heavy use of important snapshots could still exceed the cap; auto would also cover that case.

Testing

Observed the warning on every limine-snapper-sync/limine-snapper-watcher run on a 4.0-alpha (quattro) system with 6 snapshots present.

Snapper is configured with NUMBER_LIMIT="5", but limine-snapper-sync
also counts the freshly-created / currently-booted snapshot, so five
retained snapshots are reported as six entries and it warns on every
snapshot and update:

  Snapshot limit mismatch: 6 Snapper snapshots exceed configured
  MAX_SNAPSHOT_ENTRIES=5

Raise MAX_SNAPSHOT_ENTRIES to 6 (NUMBER_LIMIT + 1) so the boot-menu cap
and Snapper's retention agree and the off-by-one warning stops. (An
alternative is MAX_SNAPSHOT_ENTRIES=auto, which derives the cap from
Snapper directly; kept an explicit value here to preserve the existing
boot-menu limit.)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 5, 2026 23:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Limine’s snapshot entry cap to match Snapper retention behavior, eliminating an off-by-one warning caused by counting the currently-booted snapshot as an additional entry.

Changes:

  • Increase MAX_SNAPSHOT_ENTRIES from 5 to 6 to align with Snapper’s NUMBER_LIMIT="5" plus the currently-booted snapshot.
  • Add inline documentation explaining the rationale for the +1 adjustment and the warning it prevents.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +18
# Keep this one above the Snapper limit so the counts do not mismatch:
# Snapshot limit mismatch: 6 Snapper snapshots exceed configured
# MAX_SNAPSHOT_ENTRIES=5
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.

2 participants