Repository navigation
fix(files): use exact batch ETAs for P90 lane load accounting - #218
Merged
Merged
Conversation
During greedy lane assignment the planner tracked lane load as the sum of pre-merge P90 group ETAs and per-site ETAs, while displayed lane ETAs use merged/chunked batch ETAs. Batch ETA is max(files/QPS, size/throughput), which is not additive: merging count-bound and size-bound P90 sites overlaps them. Lanes with mixed P90 batches were overstated (8-16h on the googlellc914 run), so leftover sites landed on the already-longest lane (Batch 10 after Batch 1), raising the total ETA from ~110.7h to 116.9h. - plan_p90_lanes now keeps running totals per batch (merged P90 batch + open regular chunk) and evaluates lane load with the same eta_from_totals used for display. Each placement re-evaluates one batch ETA, so cost stays O(sites x lanes) (~0.3s for 200k sites in the planner, ~2.7s end to end). - Batch structure (merging, 5,000-site chunks, in-lane order) and the least-loaded-lane rule are unchanged. LanePlan exposes final lane_loads. - calculate_migration_batches passes per-site totals and the display ETA function. - Tests: exactness vs recomputed batch ETAs, regression for the misplacement, linear ETA-evaluation count, end-to-end with the real ETA formula. README note on lane load.
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
In a full Shallow Scan of the
googlellc914tenant (1,018 sites, 5 lanes), Batch 10 (102 small sites, 6.2h) was placed after Batch 1 in the longest lane. That pushed the total ETA to 4d 21h (116.9h), while other lanes had ~8–16h of spare capacity.Root cause
Lane load was measured one way during assignment and another way for display:
Batch ETA is
max(files ÷ QPS, size ÷ throughput), which is not additive. When count-bound and size-bound P90 sites are merged, their costs overlap, so the merged ETA is much lower than the sum. On this run the P90 batches in lanes 2–5 were overstated by 7.8 / 16.4 / 16.4 / 13.4h. Lane 1 (Batch 1, 110.7h) therefore looked like the least-loaded lane and received the leftover sites.Fix
plan_p90_lanesnow tracks each lane exactly as its batches will finally be:eta_from_totals(...)over those batches, using the same ETA function as the displayed batch ETAs.O(sites × lanes).LanePlannow also exposeslane_loads.calculate_migration_batchespasses per-site totals and the display ETA function.