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

omit PgVersion diff on sync #860

Merged
merged 3 commits into from Mar 13, 2020
Merged

omit PgVersion diff on sync #860

merged 3 commits into from Mar 13, 2020

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Mar 9, 2020

Changing the Postgres version can currently break the cluster. It is caught on Update but not on Sync.

Retrieving the current PG version on sync is only possible through the bin_dir setting in the SPILO_CONFIGURATION env variable of the postgres container. Extracting the version is done with Sscanf to make it work even when the bin path template is configurable, as suggested in #554.

This PR also adds PostgresParam where PgVersion field is read

@FxKu FxKu changed the title log error on version update earlier omit PgVersion diff on sync Mar 9, 2020
@FxKu FxKu added this to the 1.5 milestone Mar 9, 2020
pkg/cluster/sync.go Outdated Show resolved Hide resolved
@@ -716,6 +716,55 @@ func makeResources(cpuRequest, memoryRequest, cpuLimit, memoryLimit string) acid
}
}

func extractPgVersionFromBinPath(binPath string, template string) (string, error) {
var pgVersion float32
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be just an integer?

Copy link
Member Author

Choose a reason for hiding this comment

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

when there can be 9.6?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, forgot that for a couple of years it still would be a thing.

@FxKu
Copy link
Member Author

FxKu commented Mar 13, 2020

👍

1 similar comment
@erthalion
Copy link
Contributor

👍

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.

None yet

2 participants