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

Rebuilds Postgres indexes on glibc version change #2430

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

klakin-pivotal
Copy link
Contributor

What is this change about?

This commit:

  • Adds early fails to the Postgres 10 and Postgres 13 jobs if the Postgres 15 data directory is present. This omission seemed to be a clear oversight.
  • Adds code to detect glibc version changes and rebuild indexes on all Postgres databases if the running glibc is newer than 2.27, and has changed since the last time we rebuild the indexes.

glibc version 2.28 introduced a major change to how it performs collation. Whenever any changes to collations are introduced, indexes on Postgres tables must be rebuilt in order to avoid problems which include successful insertion of rows that violate uniqueness constraints on some keys but not others.

Postgres 15 and later includes code that detects and warns about this situation, but leaves correcting the issue up to the operator... so the updates in this commit are still required.

Please provide contextual information.

See: https://wiki.postgresql.org/wiki/Locale_data_changes
https://www.crunchydata.com/blog/glibc-collations-and-data-corruption

What tests have you run against this PR?

Manual testing for script correctness.

Does this PR introduce a breaking change?

No.

This commit:
* Adds early fails to the Postgres 10 and Postgres 13 jobs if the
  Postgres 15 data directory is present. This omission seemed to be a
  clear oversight.
* Adds code to detect glibc version changes and rebuild indexes on all
  Postgres databases if the running glibc is newer than 2.27, and has
  changed since the last time we rebuild the indexes.

glibc version 2.28 introduced a major change to how it performs
collation. Whenever any changes to collations are introduced, indexes on
Postgres tables must be rebuilt in order to avoid problems which include
successful insertion of rows that violate uniqueness constraints on some
keys but not others.

Postgres 15 and later includes code that detects and warns about this
situation, but leaves correcting the issue up to the operator... so the
updates in this commit are still required.

Signed-off-by: Joseph Palermo <jpalermo@pivotal.io>
@jpalermo jpalermo force-pushed the reindex-on-glibc-version-change branch from 4a71a68 to 78d6603 Compare March 2, 2023 07:17
@beyhan beyhan requested review from a team, aramprice and jpalermo and removed request for a team March 2, 2023 15:39
Copy link
Member

@lnguyen lnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@jpalermo jpalermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jpalermo jpalermo merged commit b6b6c0c into main Mar 2, 2023
@klakin-pivotal klakin-pivotal deleted the reindex-on-glibc-version-change branch March 2, 2023 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants