Skip to content

Commit d8d631f

Browse files
authored
chore(canopy): drop disaster-recovery from supported intents (#79)
2 parents c538b87 + db027cf commit d8d631f

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/bin/operator.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ const DEFAULT_CANOPY_RECONCILE_INTERVAL_SECS: u64 = 30;
4545
const CONFIGMAP_NAME: &str = "postgres-restore-operator-config";
4646

4747
/// Intent set pgro registers with canopy on startup; only worklist entries
48-
/// with a matching intent will be dispatched.
49-
const PGRO_SUPPORTED_INTENTS: &[&str] = &["verify", "analytics", "disaster-recovery"];
48+
/// with a matching intent will be dispatched. `disaster-recovery` is not
49+
/// yet supported — the code has no rehearsal lifecycle beyond "make it
50+
/// writable", which is not what DR actually needs.
51+
const PGRO_SUPPORTED_INTENTS: &[&str] = &["verify", "analytics"];
5052

5153
/// Annotate the operator's own pod with the running version.
5254
async fn annotate_own_pod(client: &Client, namespace: &str) {

src/controllers/canopy/builders.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,12 @@ pub struct PostgresDeploymentConfig<'a> {
395395
}
396396

397397
/// Build the postgres Deployment for a canopy-backed replica by
398-
/// forwarding to the shared CRD/canopy builder. Intent drives:
399-
/// - `verify` / `analytics` → `read_only=true` (default_transaction_read_only)
400-
/// - `disaster-recovery` → `read_only=false` (writable, acts as primary)
398+
/// forwarding to the shared CRD/canopy builder. Both currently-supported
399+
/// intents (`verify`, `analytics`) run the replica read-only; `analytics`
400+
/// gets heavier default resources since it serves queries. Unknown
401+
/// intents fall through to the verify-shaped defaults; canopy won't
402+
/// dispatch them because pgro doesn't register them via
403+
/// `PGRO_SUPPORTED_INTENTS`.
401404
///
402405
/// All the heavy lifting (pg_resetwal fallback, locale fixing,
403406
/// analytics-user creation, REINDEX-on-startup) comes from the shared
@@ -410,14 +413,10 @@ pub fn build_canopy_postgres_deployment(
410413
PostgresDeploymentInputs, build_postgres_deployment_with,
411414
};
412415

413-
let read_only = matches!(cfg.intent, "verify" | "analytics");
416+
let read_only = true;
414417

415-
// Intent-driven default resources. Analytics replicas serve queries so
416-
// they need more headroom than a verify-only pod that just runs once
417-
// and gets torn down. Disaster-recovery mirrors analytics for now.
418418
let (cpu_req, mem_req, cpu_lim, mem_lim, shm) = match cfg.intent {
419-
"verify" => ("250m", "512Mi", "2", "2Gi", "512Mi"),
420-
"analytics" | "disaster-recovery" => ("500m", "2Gi", "4", "8Gi", "2Gi"),
419+
"analytics" => ("500m", "2Gi", "4", "8Gi", "2Gi"),
421420
_ => ("250m", "512Mi", "2", "2Gi", "512Mi"),
422421
};
423422
let (shm_size, shared_buffers_mb) =

0 commit comments

Comments
 (0)