- Database cluster cnpg-apexalgo has 0/3 instances ready - cnpg-apexalgo-3 pod stuck Pending for 23 days (Insufficient cpu) - Schema-init pod Running but cannot connect to database - All ai-code-battle workloads Pending due to missing DB Migration code is complete and deployed (commit 1ec0c25). Verification awaits cluster CPU resolution.
2.3 KiB
BF-1BVCA: combat_turns Column Migration
Status: Migration complete (code changes done, committed, pushed). Verification blocked by infrastructure.
Work Completed
-
Schema Migration Added -
declarative-config/k8s/apexalgo-iad/ai-code-battle/acb-schema-init.yml:- Line 46:
combat_turns INTEGER NOT NULL DEFAULT 0in CREATE TABLE - Line 305:
ALTER TABLE matches ADD COLUMN IF NOT EXISTS combat_turns INTEGER NOT NULL DEFAULT 0;
- Line 46:
-
Rollout Annotation Bumped:
- Updated to
v14-combat-turns-2026-06-03-bf-1bvca-force-restart
- Updated to
-
Changes Committed and Pushed:
- Commit:
1ec0c25- "feat(apexalgo-iad): bump schema-init annotation to v14 - force restart for combat_turns migration"
- Commit:
Current Blockers (Infrastructure, not migration-related)
-
Database Cluster Down:
cnpg-apexalgoincnpgnamespace shows:NAME AGE INSTANCES READY STATUS PRIMARY cnpg-apexalgo 91d 0/3 0 Waiting for the instances to become active cnpg-apexalgo-3 NAME READY STATUS RESTARTS AGE cnpg-apexalgo-3 0/1 Pending 0 23dPod condition:
0/3 nodes are available: 3 Insufficient cpu. -
Schema-init Running but Blocked: Pod is Running but cannot connect to DB:
acb-schema-init-5b698c549d-pwx47 1/1 Running 0 3m24sLogs show: "Not ready, retrying in 5s..." (PostgreSQL not accepting connections)
-
All Workloads Pending: acb-api, acb-evolver, acb-index-builder, acb-worker all stuck in Pending.
Verification Plan
Once cluster is healthy:
- Verify
cnpg-apexalgocluster reachesHealthystatus with 3/3 instances - Schema-init pod should connect and apply migrations (check logs for "Schema applied")
- Index-builder pod should schedule successfully (check
kubectl get pods) - Verify index-builder logs show no "column combat_turns does not exist" errors
Migration Content
-- In CREATE TABLE matches statement
combat_turns INTEGER NOT NULL DEFAULT 0,
-- In migrations section
ALTER TABLE matches ADD COLUMN IF NOT EXISTS combat_turns INTEGER NOT NULL DEFAULT 0;
This migration is idempotent (uses IF NOT EXISTS) and will apply cleanly when the database becomes available.