multigres day-2 lab

Multigres on Amazon EKS · three zones · 11 recorded runs

A zone cut off, a full disk, upgrades under load. Every second, replayed.

Five day-2 operations on a three-zone Multigres cluster (the Vitess-style sharding and high-availability layer for Postgres), each recorded from both sides, what the cluster reported and what the app got.

Open the lab

Loading the recorded runs.

    ready
    acknowledged writes failed writes and app errors Shard not Healthy writer inside a cut-off zone Click the chart to jump to any moment
    lab terminal, replay

    What the recorded runs showed

    Every number below is computed in your browser from the same records the lab replays. A range is the spread across runs of the same operation.

    No acknowledged insert went missing

    After each run the drill writer re-read every insert it had been told was committed. None was missing, across 11 runs and on both sides of the partition. It checks inserts only, not reads or updates.

    The cut-off side stopped acknowledging

    Inside the cut-off zone, 8 writes already in flight were acknowledged in the first 67 ms, then nothing until the cut was healed four minutes later. The other zones promoted a new primary after about 20 s, in run 2 while the cut-off zone held 2 of the 3 etcd members.

    The Shard phase follows pod readiness

    With the primary's disk full, writes failed for 206 s. The pods stayed ready, so the phase read Healthy for about 160 s of it. Alert on the volume's free space as well.

    Switchovers held the app's queries

    The gateways held and replayed queries, and the 500 app connections saw 0 errors. The drill writer gives up after 2 s, so one write per worker timed out on its side, and most of those committed anyway.

    Replacing a gateway ends its connections

    The rolling upgrade replaced the gateway pods, which closed each app connection on them once, as any Postgres proxy would. All 500 were open again 25 s after the upgrade started.

    Run it more than once

    Two node group upgrades gave 6,288 and 158 app errors. In the first, the new primary landed on the zone 1 node, which also ran the load tool and Auth on 2 vCPUs.

    More from these drills

    The lab replays the day-2 operations. The same cluster and harness also covered these, each written up with every run.

    Failures A pod, a node, a whole zone lost 0 of 1,515,719 acknowledged writes lost across 10 drills, including a zone outage that took 2 of the 3 etcd members Backups Do the backups restore, completely? 3,033,361 of 3,033,361 acknowledged writes from 25 drill runs back from the S3 backup in one restore, and point-in-time restore exact to the second Clients What a Supabase-style app sees in a failover 500–6,533 → 2–11 client errors per run after a gateway buffer change, in 3 of 4 runs, with Supabase Auth logins measured too Service mesh Multigres under Istio with strict mTLS 1.8 → 2.6 ms read latency at p50 inside the mesh, what enrollment needs, and a failover that stalled for 46 minutes

    How it is measured

    Two kinds of load

    supafirehose, Multigres's own load tool, holds 500 app connections through the gateways: 2,000 reads and 200 writes a second, reconnecting on any error. A second tool writes 400 rows a second and records every attempt, so each acknowledged write can be looked up afterwards.

    One clock, started at the operation

    The load runs for a minute first. Every time is counted from the moment the operation starts. The Shard's phase and pod readiness are read every few seconds, and the disk every 10 to 40 seconds.

    What the picture adds

    The dots are a sample drawn from the per-second counts, and the gateway a dot passes through is picked at random. The primary is drawn moving when writes came back, the first moment the record shows clients reaching it.

    What this lab cannot tell you

    One m7i-flex.large node per zone (2 vCPU), one shard, a free-plan AWS account, one to four runs per operation. The write check covers inserts, not reads. The numbers describe this cluster on 27 November 2026. Run it on yours before you believe any of them about yours.

    The full write-up, with charts and every finding

    Run it yourself

    The same Terraform and scripts that recorded these runs, on your own AWS account. About an afternoon, and about USD 0.50 of credit an hour while the cluster exists.

    1. An AWS account and the tools

      A free-plan account is enough. Create a user for Terraform with its own CLI profile, and install Terraform, the AWS CLI v2, kubectl and Git (Git Bash on Windows). Step-by-step guide, with checks.

    2. Fill in the template

      git clone https://github.com/shanurwan/multigres-eks-drills
      cd multigres-eks-drills
      cp terraform/terraform.tfvars.example terraform/terraform.tfvars
      
      # terraform/terraform.tfvars
      region      = "ap-southeast-2"      # any region with 3 zones
      profile     = "multigres-lab"       # your CLI profile
      owner       = "your-name"
      alert_email = "you@example.com"     # the budget alarm writes here
      admin_cidrs = ["203.0.113.10/32"]   # your public IP, for the EKS API
      budget_usd  = 40

      The file is ignored by Git, so your email and IP stay on your machine.

    3. Create the cluster (about 20 minutes)

      export AWS_PROFILE=multigres-lab AWS_REGION=ap-southeast-2
      terraform -chdir=terraform init
      terraform -chdir=terraform apply
      aws eks update-kubeconfig --name multigres-lab --region $AWS_REGION
      kubectl get nodes -L topology.k8s.aws/zone-id      # three nodes, three zones

      It builds a VPC across three zones, EKS with one node group per zone, the EBS CSI driver, an S3 bucket for backups with an IAM role for it, and a budget alarm.

    4. Install Multigres (about 6 minutes)

      kubectl apply --server-side -f failure-drill/results/_versions/operator-install.yaml   # the operator build these runs used
      failure-drill/scripts/deploy.sh          # the 3-zone MultigresCluster, waits for Healthy
      failure-drill/scripts/primary.sh         # which zone holds the primary
    5. Start the load

      cd production-scenario
      scripts/build.sh                         # supafirehose and the write checker
      scripts/setup.sh <zone-id>               # the load pod
      ../failure-drill/scripts/writer.sh <another zone-id>
      cd ../day2-operations
    6. Run the lessons for real

      export CONNS=500
      WRITE_FOR=4m  scripts/day2.sh switchover 1
      WRITE_FOR=8m  scripts/day2.sh az-partition 1
      WRITE_FOR=12m scripts/day2.sh ng-upgrade 1
      WRITE_FOR=12m FILL_LEAVE_MB=1 GROW_TO=20Gi scripts/day2.sh disk-full 1
      WRITE_FOR=25m MG_IMAGE=ghcr.io/multigres/multigres@sha256:... \
        PGCTLD_IMAGE=ghcr.io/multigres/pgctld@sha256:... \
        MULTIADMIN_WEB_IMAGE=ghcr.io/multigres/multiadmin-web@sha256:... scripts/day2.sh mg-upgrade 1

      Wait for the shard to be Healthy between runs. Each run lands in day2-operations/results/.

    7. Replay your own runs here

      python3 ../production-scenario/analysis/collect.py results
      python3 analysis/day2.py
      python3 ../lab/build.py results -o my-runs.json

      Then load the file. It is read in this tab and goes nowhere else.

    8. Tear it down, every time

      kubectl -n multigres-demo delete multigrescluster demo --wait=true   # deletes its volumes
      aws s3 rm "s3://$(terraform -chdir=terraform output -raw backup_bucket)" --recursive
      terraform -chdir=terraform destroy
      aws ec2 describe-volumes --filters Name=tag:Project,Values=multigres-lab   # should be empty