DB migration jobs fail on PostgreSQL14.3 for Mastodon 4.3.0
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 197
- Forks
- 104
- Avg merge
- 22m
- Merged PRs (30d)
- 2
Description
kubectl -n mastodon logs mastodon-db-migrate-qjlsp
I, [2024-10-08T22:13:18.132471 #1] INFO -- : Migrating to AddURLToPreviewCardsStatuses (20231006183200)
== 20231006183200 AddURLToPreviewCardsStatuses: migrating =====================
[strong_migrations] DANGER: No lock timeout set
-- add_column(:preview_cards_statuses, :url, :string)
-> 0.0656s
== 20231006183200 AddURLToPreviewCardsStatuses: migrated (0.0739s) ============
I, [2024-10-08T22:13:18.239826 #1] INFO -- : Migrating to AddIndexToWebauthnCredentialsUserIdNickname (20231018192110)
== 20231018192110 AddIndexToWebauthnCredentialsUserIdNickname: migrating ======
[strong_migrations] DANGER: No lock timeout set
rake aborted!
StandardError: An error has occurred, all later migrations canceled: (StandardError)
=== Dangerous operation detected #strong_migrations ===
Adding an index concurrently can cause silent data corruption in Postgres 14.0 to 14.3.
Upgrade Postgres before adding new indexes, or wrap this step in a safety_assured { ... } block
to accept the risk.
/opt/mastodon/db/migrate/20231018192110_add_index_to_webauthn_credentials_user_id_nickname.rb:31:in `add_index_to_table'
/opt/mastodon/db/migrate/20231018192110_add_index_to_webauthn_credentials_user_id_nickname.rb:7:in `up'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Trying to upgrade the dependencies also fails as PostgreSQL16 won't open the data directory of PostgreSQL 14 to upgrade
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with db/migrate/20231018192110_add_index_to_webauthn_credentials_user_id_nickname.rb and the kubectl logs showing the failure during db:migrate. Reproduce the migration against PostgreSQL 14.3, then determine the supported path for completing it without the reported strong_migrations error. Done means the migration job proceeds past this migration on the affected deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, postgresql
- Domain
- databases, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100