Repository navigation
loader_app: Reset InstallationStore when slot count changes - #13471
Merged
Merged
Conversation
When upgrading from a 3-slot configuration (Cobalt <= 25) to a 2-slot configuration (Cobalt >= 26, introduced in b/349897494), an existing installation_store_<app_key>.pb on disk with 3 slots causes InstallationManager::Initialize() to fail if the device had rotated into Slot 2. When LoadSlotManagedLibrary() returns NULL, loader_app falls back to loading the system image without SbSystemGetExtensionShim, causing the device to permanently report Evergreen-Lite. Because any Evergreen binary installed under the 3-slot Cobalt <= 25 configuration targets an incompatible Starboard ABI (SB <= 16) and cannot be loaded by a Cobalt >= 26 (SB >= 17) loader_app, reset the on-disk InstallationStore via CreateInstallationStore() whenever installations_size() != max_num_installations_ so Slot 0 (the new system image) becomes the active slot immediately. Bug: 574461089 TAG=agy CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8
Contributor
|
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates InstallationManager::Initialize to recreate the installation store if the on-disk store's slot count does not match max_num_installations_ (e.g., during upgrades), and adds a corresponding unit test. Feedback suggests avoiding mixing TEST_F and TEST_P on the same fixture class (InstallationManagerTest) by defining a simple alias for the non-parameterized test, adhering to Chromium style guides.
yuying-y
reviewed
Oct 19, 2026
jellefoks
approved these changes
Oct 19, 2026
…slots LoadSlotManagedLibrary() initializes InstallationManager with kMaxNumInstallations = 2 (updated from 3 in b/349897494), whereas SlotManagementTest.AdoptSlot was still calling ImInitialize(3, ...) during test setup. Now that ImInitialize resets the store when the on-disk slot count does not match max_num_installations, initialize with 2 slots in AdoptSlot so the pre-configured Slot 1 state is preserved. Bug: 574461089 TAG=agy CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8
yuying-y
approved these changes
Oct 20, 2026
cobalt-github-releaser-bot
pushed a commit
that referenced
this pull request
Oct 20, 2026
…count changes Refer to original PR: #13471 When upgrading from a 3-slot configuration (Cobalt <= 25) to a 2-slot configuration (Cobalt >= 26, introduced in b/349897494), an existing `installation_store_<app_key>.pb` on disk with 3 slots causes `InstallationManager::Initialize()` to fail if the device had rotated into Slot 2. When `LoadSlotManagedLibrary()` returns `NULL`, `loader_app` falls back to loading the system image without `SbSystemGetExtensionShim`, causing the device to permanently report `Evergreen-Lite`. Because any Evergreen binary installed under the 3-slot Cobalt <= 25 configuration targets an incompatible Starboard ABI (SB <= 16) and cannot be loaded by a Cobalt >= 26 (SB >= 17) `loader_app`, reset the on-disk `InstallationStore` via `CreateInstallationStore()` whenever `installations_size() != max_num_installations_` so Slot 0 (the new system image) becomes the active slot immediately. *(Alternative to #13449)* Bug: 574461089 TAG=agy CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8 (cherry picked from commit f7c9d8d)
cobalt-github-releaser-bot
pushed a commit
that referenced
this pull request
Oct 20, 2026
…count changes Refer to original PR: #13471 When upgrading from a 3-slot configuration (Cobalt <= 25) to a 2-slot configuration (Cobalt >= 26, introduced in b/349897494), an existing `installation_store_<app_key>.pb` on disk with 3 slots causes `InstallationManager::Initialize()` to fail if the device had rotated into Slot 2. When `LoadSlotManagedLibrary()` returns `NULL`, `loader_app` falls back to loading the system image without `SbSystemGetExtensionShim`, causing the device to permanently report `Evergreen-Lite`. Because any Evergreen binary installed under the 3-slot Cobalt <= 25 configuration targets an incompatible Starboard ABI (SB <= 16) and cannot be loaded by a Cobalt >= 26 (SB >= 17) `loader_app`, reset the on-disk `InstallationStore` via `CreateInstallationStore()` whenever `installations_size() != max_num_installations_` so Slot 0 (the new system image) becomes the active slot immediately. *(Alternative to #13449)* Bug: 574461089 TAG=agy CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8 (cherry picked from commit f7c9d8d)
This was referenced Oct 20, 2026
briantting
pushed a commit
that referenced
this pull request
Oct 20, 2026
…count changes Refer to original PR: #13471 When upgrading from a 3-slot configuration (Cobalt <= 25) to a 2-slot configuration (Cobalt >= 26, introduced in b/349897494), an existing `installation_store_<app_key>.pb` on disk with 3 slots causes `InstallationManager::Initialize()` to fail if the device had rotated into Slot 2. When `LoadSlotManagedLibrary()` returns `NULL`, `loader_app` falls back to loading the system image without `SbSystemGetExtensionShim`, causing the device to permanently report `Evergreen-Lite`. Because any Evergreen binary installed under the 3-slot Cobalt <= 25 configuration targets an incompatible Starboard ABI (SB <= 16) and cannot be loaded by a Cobalt >= 26 (SB >= 17) `loader_app`, reset the on-disk `InstallationStore` via `CreateInstallationStore()` whenever `installations_size() != max_num_installations_` so Slot 0 (the new system image) becomes the active slot immediately. *(Alternative to #13449)* Bug: 574461089 TAG=agy CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8 (cherry picked from commit f7c9d8d)
briantting
pushed a commit
that referenced
this pull request
Oct 26, 2026
…count changes Refer to original PR: #13471 When upgrading from a 3-slot configuration (Cobalt <= 25) to a 2-slot configuration (Cobalt >= 26, introduced in b/349897494), an existing `installation_store_<app_key>.pb` on disk with 3 slots causes `InstallationManager::Initialize()` to fail if the device had rotated into Slot 2. When `LoadSlotManagedLibrary()` returns `NULL`, `loader_app` falls back to loading the system image without `SbSystemGetExtensionShim`, causing the device to permanently report `Evergreen-Lite`. Because any Evergreen binary installed under the 3-slot Cobalt <= 25 configuration targets an incompatible Starboard ABI (SB <= 16) and cannot be loaded by a Cobalt >= 26 (SB >= 17) `loader_app`, reset the on-disk `InstallationStore` via `CreateInstallationStore()` whenever `installations_size() != max_num_installations_` so Slot 0 (the new system image) becomes the active slot immediately. *(Alternative to #13449)* Bug: 574461089 TAG=agy CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8 (cherry picked from commit f7c9d8d)
andrewsavage1
added a commit
that referenced
this pull request
Oct 27, 2026
…#13524) Follow-up to #13471. When `InstallationManager::Initialize()` has no existing store or detects a slot count mismatch (e.g., upgrading from a 3-slot Cobalt <= 25 configuration to a 2-slot Cobalt >= 26 configuration), call `Reset()` so that any existing incompatible slot directories on disk are also cleaned up. Updates `Reset()` and `CleanInstallationDirs()` to: - Run `CleanInstallationDirs()` before `CreateInstallationStore()` and delete slot directories `1..installation_store_.installations_size() - 1` (removing any obsolete directories such as `installation_2` when shrinking from 3 slots to 2, and acting as a no-op when no previous store existed). - Recreate active slot directories via `CreateInstallationDirs()`. Bug: 574461089
cobalt-github-releaser-bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
…when slot count changes Refer to original PR: #13524 Follow-up to #13471. When `InstallationManager::Initialize()` has no existing store or detects a slot count mismatch (e.g., upgrading from a 3-slot Cobalt <= 25 configuration to a 2-slot Cobalt >= 26 configuration), call `Reset()` so that any existing incompatible slot directories on disk are also cleaned up. Updates `Reset()` and `CleanInstallationDirs()` to: - Run `CleanInstallationDirs()` before `CreateInstallationStore()` and delete slot directories `1..installation_store_.installations_size() - 1` (removing any obsolete directories such as `installation_2` when shrinking from 3 slots to 2, and acting as a no-op when no previous store existed). - Recreate active slot directories via `CreateInstallationDirs()`. Bug: 574461089 (cherry picked from commit d12af58)
cobalt-github-releaser-bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
…when slot count changes Refer to original PR: #13524 Follow-up to #13471. When `InstallationManager::Initialize()` has no existing store or detects a slot count mismatch (e.g., upgrading from a 3-slot Cobalt <= 25 configuration to a 2-slot Cobalt >= 26 configuration), call `Reset()` so that any existing incompatible slot directories on disk are also cleaned up. Updates `Reset()` and `CleanInstallationDirs()` to: - Run `CleanInstallationDirs()` before `CreateInstallationStore()` and delete slot directories `1..installation_store_.installations_size() - 1` (removing any obsolete directories such as `installation_2` when shrinking from 3 slots to 2, and acting as a no-op when no previous store existed). - Recreate active slot directories via `CreateInstallationDirs()`. Bug: 574461089 (cherry picked from commit d12af58)
briantting
pushed a commit
that referenced
this pull request
Nov 9, 2026
…when slot count changes Refer to original PR: #13524 Follow-up to #13471. When `InstallationManager::Initialize()` has no existing store or detects a slot count mismatch (e.g., upgrading from a 3-slot Cobalt <= 25 configuration to a 2-slot Cobalt >= 26 configuration), call `Reset()` so that any existing incompatible slot directories on disk are also cleaned up. Updates `Reset()` and `CleanInstallationDirs()` to: - Run `CleanInstallationDirs()` before `CreateInstallationStore()` and delete slot directories `1..installation_store_.installations_size() - 1` (removing any obsolete directories such as `installation_2` when shrinking from 3 slots to 2, and acting as a no-op when no previous store existed). - Recreate active slot directories via `CreateInstallationDirs()`. Bug: 574461089 (cherry picked from commit d12af58)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When upgrading from a 3-slot configuration (Cobalt <= 25) to a 2-slot configuration (Cobalt >= 26, introduced in b/349897494), an existing
installation_store_<app_key>.pbon disk with 3 slots causesInstallationManager::Initialize()to fail if the device had rotated into Slot 2. WhenLoadSlotManagedLibrary()returnsNULL,loader_appfalls back to loading the system image withoutSbSystemGetExtensionShim, causing the device to permanently reportEvergreen-Lite.Because any Evergreen binary installed under the 3-slot Cobalt <= 25 configuration targets an incompatible Starboard ABI (SB <= 16) and cannot be loaded by a Cobalt >= 26 (SB >= 17)
loader_app, reset the on-diskInstallationStoreviaCreateInstallationStore()wheneverinstallations_size() != max_num_installations_so Slot 0 (the new system image) becomes the active slot immediately.(Alternative to #13449)
Bug: 574461089
TAG=agy
CONV=f84ec944-1df8-493c-836e-9f9ddabba3e8