TRAFFIC SHIFT · FOLLOW EACH REQUEST
Traffic shifting: follow each routed request
Shift traffic from v1 to v2 in three steps while four users hold multi-turn sessions, and follow which version serves every turn.
Your experiment
v2’s weight is 10% until minute 4, 50% until minute 8, then 100%. Four users each have a three-turn session; their hash buckets are 7, 33, 61 and 88. Start with a random choice per request, then route by user and by session, add a rollback at minute 6 and make v1 able to read v2’s session state.
Play replays the computed run over sixty inspection seconds; Next event steps, Restart rewinds, Speed changes the pace and Inspection time scrubs. Any input change recomputes the run and rewinds it without autoplay.
Event trace
Computed data
Final metrics
Deterministic model: “random” uses a fixed list of twelve numbers and a user is routed to v2 when the number or bucket is below the current weight. A rollback overrides every routing key. A v1-to-v2 change is assumed safe because v2 reads v1 state; v2-to-v1 breaks unless compatibility is checked.
Random per request splits sessions
v2’s weight rises from 10% to 50% at minute 4 and to 100% at minute 8. Four users each have a three-turn session. With a random choice per request, sessions jump between versions: S2, the session of user u2, is served by v2 at minute 2 and by v1 at minute 6, and v1 cannot read the state v2 wrote, so that turn fails. BROKEN TURNS: 1 broken among 4 mid-session version changes, while v2 serves 8 of 12 requests.
Stable buckets per user
Choose Stable hash bucket per user. A user moves to v2 once the weight passes their bucket and never moves back while weights only rise: three users change from v1 to v2 mid-session, which is safe because v2 reads v1 state, and the result is FLIPS HANDLED with 8 of 12 requests on v2. Pinned per session at its first turn removes every mid-session change, but sessions keep the version they started on, so v2 serves only 3 of 12 requests even after the weight reaches 100%.
A rollback flips sessions back
Check Roll back to 0% at minute 6. Every routing key now sends later turns to v1, and any session that already used v2 flips from v2 to v1: with per-user or per-session routing that is the user in bucket 7, whose third turn fails; with per-request routing 2 turns fail. A rollback cannot respect stickiness if it is to stop exposure.
Make the way back safe
Check v1 can read session state written by v2. The same flips now succeed: FLIPS HANDLED. Traffic shifting only works in both directions when each version can read what the other writes, so that compatibility has to be designed into the release, not discovered during a rollback.
Reading the run and its limits
Play, Next event, Restart, Speed and Inspection time follow every one of the twelve turns across sixty seconds; the table lists the weight at each turn, the version that served it and any version change. The random numbers are a fixed list, buckets are given and the rollback is instantaneous; real routers also handle connection reuse, retries and streaming sessions.