fix(syncer-updates): separate target from floors in update logic#1291
Open
ervcz wants to merge 1 commit into
Open
fix(syncer-updates): separate target from floors in update logic#1291ervcz wants to merge 1 commit into
ervcz wants to merge 1 commit into
Conversation
4fc1de7 to
ca2d4b8
Compare
17439e7 to
efd1f3d
Compare
2d52519 to
410381d
Compare
410381d to
0ef741f
Compare
0ef741f to
db18dd5
Compare
a0b40ea to
a345261
Compare
7c54b45 to
cbf596a
Compare
71a3566 to
a2e56c4
Compare
a2e56c4 to
2875f04
Compare
Bug: Syncer received batches with the target even if there were still floor packages waiting to be sent. The target would have been used by the next syncer omaha request and that prevented preparing the remaining floors to be sent. - Update GetUpdatePackagesForSyncer to handle floors and target separately - Fix tests for multi-step-updates floor pagination for syncers - Modify update selection to prioritize floors before target package - Add LIMIT+1 query pattern for floor pagination detection - Update architecture decisions doc Signed-off-by: Ervin Rácz <ervin.racz@protonmail.com>
ca2d4b8 to
02fcbcd
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes floor-package pagination for syncer update responses by separating floors from the target in the server update selection logic, and teaching the syncer to advance its reported version across floor-only batches until the target is finally included.
Changes:
- Server API now returns
(floors, target, error)for syncers, omitting the target when more floors remain pastNEBRASKA_MAX_FLOORS_PER_RESPONSE. - Floor query uses a
LIMIT + 1strategy to detect whether additional floors remain. - Syncer tracks the highest floor version when no target is present; adds pagination-focused tests and updates ADR documentation.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/ARD-001-multi-step-updates.md | Removes the standalone ARD doc (content consolidated elsewhere). |
| docs/architecture-decisions.md | Adds ADR-002 describing multi-step updates and the floor pagination behavior. |
| backend/pkg/syncer/syncer.go | Updates multi-manifest processing to advance tracked version when receiving floor-only batches. |
| backend/pkg/syncer/syncer_multimanifest_test.go | Adds a syncer-side test for floor limit version tracking across rounds. |
| backend/pkg/omaha/omaha.go | Splits syncer response assembly into floors vs target; omits target when more floors remain. |
| backend/pkg/omaha/omaha_floors_test.go | Refactors/extends Omaha tests to cover floor pagination and target inclusion rules. |
| backend/pkg/omaha/helpers_test.go | Adds a shared doSyncerRequest helper for Omaha syncer test requests. |
| backend/pkg/api/updates.go | Refactors update selection helpers and syncer update API to return floors and target separately. |
| backend/pkg/api/packages.go | Minor formatting cleanup in a SQL query. |
| backend/pkg/api/packages_floors.go | Introduces GetRequiredChannelFloorsWithLimit with LIMIT+1 pagination detection. |
| backend/pkg/api/packages_floors_test.go | Updates tests to use the new floor query API and verifies the hasMore flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+113
to
+117
| - If package 3602.2.0 requires 3510.2.0 as prerequisite | ||
| - Later, 3815.0.0 is released WITHOUT prerequisites if prerquisit is not inherited | ||
| - Clients can jump directly to 3815.0.0, bypassing 3510.2.0 | ||
|
|
||
| This means ALL future packages would need to inherit prerequisites, even for unrelated changes. Floor-based semantics solve this by making checkpoints a channel policy, not a package property. This way we have a central management of update path instead of tracking prerequisits for all later packages individually. |
Comment on lines
+480
to
+483
| // After round 1: syncer should track highest floor (2000.0.0) | ||
| // Channel should NOT be updated (no target in response) | ||
| trackedVersion := syncer.versions[desc] | ||
| t.Logf("After round 1, syncer tracked version: %s", trackedVersion) |
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.
Problem
When more floor packages exist than
NEBRASKA_MAX_FLOORS_PER_RESPONSE, the server incorrectly included the target in every batch. This caused syncers to skip remaining floors.Solution
Changes
GetUpdatePackagesForSyncerreturns(floors, target, error)separatelyGetRequiredChannelFloorsWithLimituses LIMIT+1 to detect remaining floorsTestFloorLimitPaginationandTestSyncer_FloorLimitVersionTracking