Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 24.5.0 breaks PostgreSQL indexes and causes upgrade to fail sometimes #3107

Closed
afaianswq opened this issue Jun 4, 2024 · 7 comments · Fixed by #3116
Closed

Comments

@afaianswq
Copy link

Self-Hosted Version

24.5.0

CPU Architecture

x86_64

Docker Version

26.1.3

Docker Compose Version

2.27.0

Steps to Reproduce

1, Upgrade Sentry from version 24.4.1 or below to 24.4.2 or above

Expected Result

Sentry successfully upgraded

Actual Result

Upgrade either fails (see #3027) or you'll get PostgreSQL indexes broken which will cause other issues after the upgrade.

The reason for this is because in version 24.4.2 image for postgres was changed from "postgres:14.5" (debian based, classic glibc) to "postgres:14.11-alpine" (alpine, musl libc). PostgreSQL is known to have issues with indexes when libc version or implementation changes. Please refer to this documentation article: https://wiki.postgresql.org/wiki/Locale_data_changes#What_to_do

Event ID

No response

@azaslavsky
Copy link
Contributor

Postgres was bumped to 14.11 for security reasons. You'll need to re-index as described in #3027

@azaslavsky
Copy link
Contributor

The other options is to change postgres:14.11-alpine to postgres:14.11. If this works, we may just change the image going forward.

@afaianswq
Copy link
Author

Both options are workarounds, not a real solution. This is a BUG and you need to fix it. For example, a proper solution would be to change postgres image back to default (debian-based, i.e. postgres:14.11). Because otherwise people will have to change it every time they upgrade their installation. Alternatively, if you want to keep alpine version, you have to figure out ALL affected indexes and add a migration step that will reindex all of them before any other database-related tasks are executed.

@afaianswq
Copy link
Author

Postgres was bumped to 14.11 for security reasons.

Also, I just want to make it clear one more time, the problem is not postgres version. Problem is that you have changed from debian-based image to alpine-based image.

@azaslavsky
Copy link
Contributor

Does using postgres:14.11 work for you? I want to get reports from the field before changing the version. Using this workaround will help us decide how to proceed.

@afaianswq
Copy link
Author

Does using postgres:14.11 work for you?

Yes, it does.

@hubertdeng123
Copy link
Member

I have opened a PR to change this. Thanks for following up here @afaianswq

@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants