# Upgrade 0.2.0 -> 0.2.1 (recorded as 1.0.0 -> 1.0.1), and the planner's updated_at sort key (2026-10-07)

> **Version names:** this evidence was recorded while the release was planned as v1.0.0 (it ships as v0.2.0)
> and the follow-up as 1.0.1 (now v0.2.1); chlift stays on 0.x. Checksum-pinned files keep the names they were recorded with.

On the one-server node of `docs/evidence/installer/one-server-e2e/` (Ubuntu 24.04, systemd; Postgres 16, ClickHouse
and PeerDB on one host). Raw output; home paths replaced with `~`; `SHA256SUMS`.

Binaries: **A** = an earlier v1.0.0 candidate (5f514f6) built before the planner fix; that fix is on main for v1.0.0
(6f12ba4), so the v1.0.0 candidate (main 9c3d5d6) plans `ORDER BY (id)` as B2 does. **B** = 1.0.1 work before the planner fix; **B2** = with it;
**B3** = with it and the clearer skip reason.

## The binary swap
- `A-plan.log`, `A-start.log`, `A-status.log` (A): mirror `chlift_up` for `public.users`: RUNNING, 20000 rows on both sides.
- `B-install.log` (B): `install` re-run on the same host: 7 checks ok, "clickhouse-server running" (nothing restarted).
- `B-status.log` (B): the mirror A made is RUNNING, 20000 = 20000.
- `B-abort.log` (B): mirror, peers, ClickHouse database and publication dropped; "mirror slots left: 0".

So upgrading is: replace the binary (verify it with `SHA256SUMS`); existing mirrors keep working.

## Found on the way: updated_at in the sort key
- `A-plan.log`: users (no updates recorded yet) got `ORDER BY (account_id, updated_at, id)`.
- `cdc-users.sql`, `cdc-users.log`: 2000 inserts, 1538 updates that change `updated_at`, 689 deletes.
- `B-check.log` (B): `migrate check` fails: postgres 21311 rows, ClickHouse 22849; 1 checksum bucket differs.
- After `pg_stat_reset()` (update counters 0): `B-plan-reset.log` (B) still plans `ORDER BY (account_id, updated_at, id)`;
  `B2-plan-reset.log` (B2) plans `ORDER BY (id)`.
- `B2-start.log`, `B2-status.log`, `cdc-users-2.sql`, `cdc-users-2.log` (B2): 2000 inserts, 1485 updates that change
  `updated_at`, 623 deletes; `B2-check.log`: 22688 = 22688 rows, 0 of 64 buckets differ. `B2-abort.log`: cleaned up.
- `B2-plan-auto.log` (B2), `B3-plan-auto.log` (B3): auto-plan skips users and accounts; B3 says why ("only
  updated_at, which updates rewrite").
