You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(canopy): tear down ephemeral (verify) replicas after verification
A `verify` replica's job is to prove a snapshot restores, not to serve
queries. It was booting postgres and then idling forever. Add
`spec.ephemeral` (default false; set true by the verify intent): once a
restore reaches Active (postgres came up healthy, and for canopy
replicas the RestoreVerification was reported in the switchover block),
the reconciler records `status.verifiedSnapshotId` and deletes the
restore, reclaiming the Deployment + PVC. The replica CR and namespace
stay so canopy's worklist stays satisfied.
Re-restore is gated on the verified marker: with no active restore after
teardown, the reconciler compares the desired snapshot against
`verifiedSnapshotId` instead of a (now absent) active restore, so it only
restores again when canopy offers a newer snapshot (canopy path) or the
schedule fires (legacy path). Without the marker the
active-restore-deleted / desired-changed triggers would loop.
The analytics intents keep ephemeral=false (long-lived query replicas).
Gated entirely behind spec.ephemeral, so non-ephemeral replicas are
unchanged.
Adds an integration test (tests/ephemeral.rs, new CI matrix entry) that
does not need stub-canopy: it drives a legacy ephemeral replica through
restore -> Active -> teardown and asserts no re-restore loop.
Does NOT include the requested health_details on RestoreVerification:
bestool-canopy 0.4.3 has no such field yet. Deferred until the crate
ships it.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,7 @@ Defines a continuously-refreshed replica of a PostgreSQL database restored from
103
103
| `affinity` | `Affinity` | No | — | Pod scheduling affinity rules. |
104
104
| `tolerations` | `[]Toleration` | No | `[]` | Pod tolerations. |
105
105
| `readOnly` | `bool` | No | `true` | Set the restored database to read-only mode. |
106
+
| `ephemeral` | `bool` | No | `false` | Tear the restore down once it reaches `Active` (postgres came up healthy) instead of keeping it running. The replica only restores again when a newer snapshot is offered (canopy path) or the schedule next fires (legacy path). Used by the `verify` intent, whose job is just to prove the snapshot restores. |
106
107
| `postgresExtraConfig` | `string` | No | — | Extra lines appended to `postgresql.conf` (e.g. `shared_preload_libraries`). |
107
108
| `notifications` | `[]NotificationConfig` | No | `[]` | Notification targets called on restore events. |
108
109
| `persistentSchemas` | `[]string` | No | — | List of schema names to migrate from the previous restore to the new restore on each switchover. See [Persistent schemas](#persistent-schemas) below for the migration time budget and what happens on timeout. |
@@ -180,6 +181,7 @@ Additional fields for `target: graphQL`:
180
181
| `nextScheduledRestore` | `Time` | When the next scheduled restore will occur. |
181
182
| `latestAvailableSnapshot` | `string` | Snapshot ID of the latest available snapshot matching the filter. |
182
183
| `canopyDesiredSnapshotId` | `string` | For canopy-sourced replicas: the snapshot the canopy worklist syncer wants restored. The reconciler triggers a new restore when this differs from the current one. |
184
+
| `verifiedSnapshotId` | `string` | For `ephemeral` replicas: the last snapshot that was verified and then torn down. Gates re-restore — the reconciler only restores again when the desired snapshot differs from this. |
0 commit comments