Interview Prep/CI/CD/Deployment, Kubernetes and GitOps Failures

Database migration job in the pipeline fails with `Lock wait timeout exceeded`.

AdvancedTroubleshootingDeployment, Kubernetes and GitOps Failures
Answer

Likely causes → Long-running transaction or app holding locks on the table; migration needs an exclusive lock.

Diagnose → SHOW PROCESSLIST / pg_stat_activity and pg_locks.

Fix → Run during low traffic, use online schema change tools, set lock_timeout and retry, split the migration.

Prevent → Review migrations for locking behaviour; use expand/contract.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Deployment, Kubernetes and GitOps Failures