RHINENG-27056: adding major migration runbook + doc updates#2244
Conversation
Reviewer's GuideAdds a detailed major database migration runbook and wires it into existing docs so ops/engineers understand the db-migration Job, init-container flow, session handling, and flags like terminate_db_sessions, plus where to find related code and diagnostics. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
bb3ca4c to
0ea7852
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2244 +/- ##
=======================================
Coverage 59.06% 59.06%
=======================================
Files 138 138
Lines 8848 8848
=======================================
Hits 5226 5226
Misses 3076 3076
Partials 546 546
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0ea7852 to
a3b04f6
Compare
a3b04f6 to
19be2c0
Compare
|
|
||
| ### DDL lock diagnostics | ||
|
|
||
| Replace `system_inventory` with the table your migration touches: |
There was a problem hiding this comment.
hmm i don't see a table name referenced in the query following this instruction. is the diagnostic query meant to filter on the table name?
| AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid | ||
| AND blocking_locks.pid != blocked_locks.pid | ||
| JOIN pg_stat_activity blocking ON blocking.pid = blocking_locks.pid | ||
| WHERE NOT blocking_locks.granted; |
There was a problem hiding this comment.
compared this to the query AWS provided in slack and used cursor to help me understand 😅 it looks like the final WHERE clause might need to be blocked_locks.granted vs blocking_locks.granted, or it could be omitted since the JOIN already includes the NOT blocked_locks.granted condition
| - A single **db-migration** ClowdApp Job runs `migrate` once per deploy (`completions: 1`, `parallelism: 1`). | ||
| - Manager, listener, evaluator, and other components use a **check-for-db** init container that polls until the schema matches (`database_admin/check-upgraded.sh`). | ||
|
|
||
| Before DDL, database-admin sets app users (`listener`, `evaluator`, `manager`, `vmaas_sync`) to `NOLOGIN`, waits for sessions to drain, optionally terminates lingering backends (`terminate_db_sessions`), runs `MigrateUp`, then restores `LOGIN`. |
There was a problem hiding this comment.
this is probably me stating the obvious but since the terminate_db_sessions flag is in another branch with additional docs there, this will just need to be rebased once that's merged :)
This PR:
db-migrationJob +check-for-dbinit, session handling, andterminate_db_sessionsflagdatabase.md,architecture.md, andAGENTS.mdSummary by Sourcery
Document major database migration operations and link a new runbook from existing docs for agents and operators.
Documentation: