Skip to main content

Replica session prediction practice

Attempt before reference code or calibration.

  1. For x=1, y=2, x=3, list state at each prefix 0–3. Explain why reading a missing key successfully carries a prefix too.
  2. Give both followers received=3 but applied=1 and 2 respectively. Predict reads requiring 0, 2 and 3. Receipt alone must not satisfy a read guard.
  3. Write at 1, observe a read at 3, then route to a replica at 1. Compare write-only and merged session tokens.
  4. Stop the leader while all followers lag behind the token. Define bounded wait/fallback/failure behavior without silently returning stale data.
  5. Try to apply 2 after receiving only 1. Then try to regress apply from 2 to 1. State which invariant each breaks and what state remains after rejection.
  6. Construct two streams with the same numeric position but different values. Explain why tokens cannot be compared across them.
  7. Transfer to a migration: write down who owns the partition at every stage and how the required prefix becomes available to the new owner. Preserve the original Lab 4 retry/crash evidence.

Add three independent executable traces and a written two-shard counterexample. Keep predictions, outputs, corrections and uncertainty separate. Do not label sequence numbers as milliseconds or infer latency from interpreter execution time.