Skip to content

Remove a generation when its activation is refused - #85

Merged
jhuntwork merged 1 commit into
mainfrom
discard-unactivated-generation
Nov 3, 2026
Merged

jhuntwork merged 1 commit into
mainfrom
discard-unactivated-generation

Conversation

@jhuntwork

@jhuntwork jhuntwork commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

applyProfileRealization creates the new system generation, then activates it.
The service policy check runs inside activation, so a refused transition, for
example an uninstall that would remove a running service, left the new
generation on disk. It is higher than the current generation and has no GC
root. GC retention keeps the newest generations by number and does not check
whether a generation was ever activated, so it counted among them. With the
default retention of two it displaced an earlier generation: with generations
1 to 3 and 3 current, GC would delete gen-1, and with an unactivated gen-4 it
would delete gen-1 and gen-2.

Remove the generation this call created when activation fails, unless it has
become the current generation. A failure to remove it is logged and does not
replace the activation error. Add a test that refuses an uninstall and checks
the created generation is gone and the history is intact, and one that checks
the current generation is never removed.

The activation test fixtures are made public so the install tests can use
them. A fixture generation now carries a realization, which a child generation
reads from its parent.

applyProfileRealization creates the new system generation, then activates it.
The service policy check runs inside activation, so a refused transition, for
example an uninstall that would remove a running service, left the new
generation on disk. It is higher than the current generation and has no GC
root. GC retention keeps the newest generations by number and does not check
whether a generation was ever activated, so it counted among them. With the
default retention of two it displaced an earlier generation: with generations
1 to 3 and 3 current, GC would delete gen-1, and with an unactivated gen-4 it
would delete gen-1 and gen-2.

Remove the generation this call created when activation fails, unless it has
become the current generation. A failure to remove it is logged and does not
replace the activation error. Add a test that refuses an uninstall and checks
the created generation is gone and the history is intact, and one that checks
the current generation is never removed.

The activation test fixtures are made public so the install tests can use
them. A fixture generation now carries a realization, which a child generation
reads from its parent.
@jhuntwork
jhuntwork force-pushed the discard-unactivated-generation branch from 2b0ed73 to d261ec7 Compare November 3, 2026 04:19
@jhuntwork
jhuntwork merged commit 43dcf46 into main Nov 3, 2026
2 checks passed
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.

1 participant