Sorting Out glibc Collation Challenges
summary
Shows that glibc collation changes between OS releases silently corrupt Postgres indexes: upgrading from 2.17 to newer glibc changes sort order, causing duplicate-key errors, wrong partition placement and broken merge joins. Reproduces the issue with a 26 million-string torture test (MD5 and timings change; sort time jumps from ~3 to ~56 minutes) and with simple PK/partition examples. Delivers a compatibility libc RPM that extracts locale code, details the ~900 patches and build steps, and validates that using it restores old semantics so full re-index required downtime can be avoided.
AI-written summary · about
chapters (11)
- 0:00Introduction to the problem
- 2:52Collations and index breakage
- 8:08Fixing corrupted indexes
- 10:55Collation torture testing
- 17:31Performance regressions
- 22:36Distributed system pitfalls
- 25:29Why this problem matters
- 29:08Future solutions
- 33:38Compact collation library
- 38:11Implementation and build
- 51:56Conclusion and verification








