Interview Prep/AWS/RDS, Aurora and DynamoDB

An RDS major version upgrade fails, and the event says `Database instance is in a state that cannot be upgraded: PreUpgrade checks failed`.

AdvancedTroubleshootingRDS, Aurora and DynamoDB
Answer

Likely causes → Pre-checks found blockers: unsupported extensions or extension versions (PostGIS, pg_repack), reg* data types, open prepared transactions, logical replication slots, or for MySQL, objects incompatible with 8.0/8.4 (reserved words, old temporal types).

Diagnose →

aws rds describe-events --source-identifier mydb --source-type db-instance --duration 60
aws rds describe-db-log-files --db-instance-identifier mydb --filename-contains upgrade
aws rds download-db-log-file-portion --db-instance-identifier mydb --log-file-name <precheck-log> --output text
aws rds describe-db-engine-versions --engine postgres --engine-version 15.8 --query 'DBEngineVersions[].ValidUpgradeTarget[].EngineVersion'

Fix →

  1. Upgrade the extensions (ALTER EXTENSION postgis UPDATE;), drop replication slots, and commit or roll back prepared transactions
  2. Retry with a matching custom parameter group for the target version
  3. For minimal downtime, use RDS Blue/Green Deployments

Prevent → Rehearse upgrades on a restored snapshot, and use Blue/Green for major versions.

aws All AWS questions Roadmap: AWS core services

More on RDS, Aurora and DynamoDB