Repository navigation
Conversation
pickWeightedOrLeastLoaded measured state.busy plus the engine waiting list. Kinds that run their own slot pool and time work with serveWithin() (db, searchindex, timeseriesdb, graphdb, vectordb, replica, shard, coldstorage) leave both at 0, so every one of them looked idle and an equal-weight load balancer in front of them sent all traffic to the first. Add an optional load() behaviour hook, (in service + waiting) / slots, implemented by those kinds; the picker uses it when present and keeps the old formula otherwise. Pure read, no RNG, so determinism holds.
|
@palash247 is attempting to deploy a commit to the breakscale OSS Program Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Bug
An equal-weight load balancer in front of database nodes sends every request to the first one.
pickWeightedOrLeastLoadedmeasurestarget.busy + waiting. Kinds that run their own slot pool and time work throughserveWithin()(db,searchindex,timeseriesdb,graphdb,vectordb,replica,shard,coldstorage) keepbusyand the engine queue at 0, so they always look idle and the index tie-break picks the first edge every time.Repro
client 300 rps → lb → three
dbnodes (capacity 4, serviceMs 20, so 200 rps ceiling each). After 10 s: arrival rates[~300, 0, 0]; the first db queues and sheds while the other two sit idle. Same for the other seven kinds. Threeservicenodes split the load as expected.Fix
ComponentBehaviour.load(ctx, state): (in service + waiting) / slots. Pure read, no RNG.replica,shardandcoldstorage.Test
src/sim/lbPooled.test.ts: the repro above forserviceand each affected kind (every node must get > 50 rps), plus a determinism check.vitest run): 58 files, 1259 tests pass.tsc -bclean,oxlintno new warnings.Not verified: run with npm +
npx vitest run, not bun.