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

Fixes #37874 - don't try to swap modules, this can fail #982

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Oct 2, 2024

instead use single-user mode cluster based on the postgresql-upgrade
binaries

instead use single-user mode cluster based on the postgresql-upgrade
binaries
line.match(/dat(collate|ctype)\s+=\s+(\S+)/) do |m|
data[m[1]] = m[2].delete('"')
end
end
Copy link
Member

Choose a reason for hiding this comment

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

What an ewwww block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the output in single user mode is a bit eww (well, it's used for debugging, not running real stuff), and we gotta parse that. :/

Copy link
Member

Choose a reason for hiding this comment

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

Using /dat(collate|ctype)\s+=\s+"(\S+)"/ as the regex removes the need for .delete('"'), making it more ew than ewwww.

I do wonder about error handling: what if data doesn't contain any values because the process failed to start up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Then the upgrade will fail as we pass invalid data in PGSETUP_INITDB_OPTIONS -- nothing new compared to how it was before this whole hack 🙈

@evgeni evgeni merged commit 67702be into develop Oct 2, 2024
8 checks passed
@evgeni evgeni deleted the i37874 branch October 2, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants