Bulk COLA Runs — Scaling & Operations

For an operator enabling or sizing the October-COLA bulk redetermination runs (ADR-002 Amendment 1 and Amendment 3). The archived #1213 program plan carries the design and the B/C/H labels this page used to quote. Settings live in BulkSettings (services/canopy-eligibility/src/bulk/config.rs); every figure below is a default there unless another file is named.

Preconditions

  • Deploy order — snap fleet first, then eligibility. snap ships the fail-closed attestation writer (attestation_disabled, services/canopy-snap/src/api/determine_policy.rs) and the trigger emission; only then set CANOPY_ELIGIBILITY__BULK_RUNS_ENABLED=true (bulk_runs_enabled, services/canopy-eligibility/src/config.rs). During a rolling snap restart an old replica lacks the guard: its unattested write is caught by the orchestrator’s post-verify binding (provenance_rejected, bulk/arm.rs) and recovered by adopt-or-skip once the fleet settles.

  • Boot requirements (fail-closed: BulkSettings::resolve and validate_environment). renewals_url and rules_url set; snap in the program registry; db_max_connections ≥ 2K+4 (the per-replica total is db_max_connections plus the 2K+2 bookkeeping pool).

  • CANOPY_MQ_PREFETCH_COUNT=1 on every eligibility replica, enabled or not. The determination.requested consumers attach on every boot. An absent value is the 32 default, and 0 or garbage refuses the boot outright (canopy_mq::MqTuning, #2578). Boot refuses any prefetch but 1 (validate_consumer_environment, which checks the subscriber’s own value).

Steps

  1. Grant the broker ACL. Give the eligibility broker user topic-write on canopy.events using the canopy-eligibility user’s write regex from devstack/rabbitmq/definitions.json — copy the whole pattern, never a subset: it also covers determination.order_failed and eligibility.cross_program_alerts.accessed, and a shorter regex makes the broker ACCESS_REFUSE those publishes.

  2. Pre-declare the queue. canopy-eligibility.bulk-redetermination (bulk/consumer.rs), durable, with its dead-letter queue on the shared canopy.dlq exchange (crates/canopy-mq/src/subscriber.rs); alarm on canopy.unrouted.

  3. Routing preflight. Publish and consume one synthetic determination.requested on a prefixed queue before the first enabled deploy.

  4. Deploy snap, then eligibility with the flag on (Preconditions).

  5. Enact preflight, per run. Preview complete and the failures page reviewed — overriding an unclean preview is audited. The enact ladder (services/canopy-eligibility/src/api/bulk_runs_support.rs) re-resolves corpus and provenance and requires exact pin equality, snap’s attestation_enabled, and snap legal-today ≥ the run’s as_of: an enact on September 30 is a typed 409 enact_too_early.

Sizing (defaults in BulkSettings::resolve)

Setting Default Bound and rationale

bulk_consumer_concurrency (K)

2

1..=4 consumers per replica.

bulk_max_inflight

16

≥ 1.

bulk_self_call_timeout_secs

90

Capped at 240, below the 300 s STALE_REQUEST_TTL, so an admitted self-call settles before the sweep can reclassify its request row.

bulk_redispatch_ttl_secs

1800

Must exceed max_inflight × timeout / K, the worst-case honest drain of a full dispatch window.

bulk_max_cohort_cases

1000

Raising it is a sizing decision; the in-place apply landed with #806 (expedited certifications are excluded at admission).

bulk_max_attempts

5

1..=20; the consumer’s nack budget before a delivery dead-letters.

Throughput ≈ replicas × K × (1 / determine latency); the canary holds the first case solo per phase.

Verify — the soak gate (pre-production)

A cohort of at least 5K seeded cases on at least two replicas with K=2, with next-fiscal-year parameter fixtures staged so the preview/enact amount delta is asserted (the devstack stages one parameter set, so its suite pins provenance, not deltas). Watch: sustained settles per minute; interactive acceptance (success/409 rate and p95) during the drain; a monotone backlog; breaker, canary and deadline drills; the canopy.unrouted alert rule and consumer-attach degradation firing.

Rollback

Set CANOPY_ELIGIBILITY__BULK_RUNS_ENABLED=false and redeploy eligibility: the cohort dispatcher/finalizer worker stops; the determination.requested consumers, the order sweep and the run pause/cancel/GET routes stay live.

NOTE
History — the #1213 program (2026) shipped this contract; #1504 later made the determination.requested consumers and the prefetch check unconditional.
Edit this page · default