Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should address: #208
Problem
There was a previous release that resulted in a collation version change. Users running the old version will run into collation mismatch issues when upgrade to the latest release. A change in collation can lead to corrupt indexes and other problems as the database system relies on stored objects having a certain sort order.
How we are addressing it
Collation is managed per-database, so when the primary boots we will establish a local connection to each database and refresh the associated collations.
The refresh operations are pretty lightweight, however, it does require us to establish a connection per-database which is something we don't want to do on every boot. To mitigate this, we take a hash of the locale version and persist it to disk once we have confirmed that no collation issues are present. Then on every subsequent boot, we simply compare the OS locale version with the version on disk and short-circuit if they match.
Important notes
Refreshing the collation will update the version to match the OS locale version, however, there could some cases where certain objects need to rebuilt...
If you are running Flex version of
< v0.0.43
, then you may see some warnings like the following while you upgrade:These warnings will continue until your primary is upgraded.
Reference
https://www.postgresql.org/docs/current/sql-altercollation.html