-
Notifications
You must be signed in to change notification settings - Fork 614
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
Unbreak Debian support with custom encoding #1564
base: main
Are you sure you want to change the base?
Changes from all commits
ed8e752
9f589ff
f562902
62c5fc5
cd67d13
256971d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,11 +135,7 @@ def matches(value) | |
end | ||
|
||
autorequire(:anchor) do | ||
["postgresql::server::service::begin::#{self[:instance]}"] | ||
end | ||
|
||
autorequire(:service) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to understand the logic. Don't you always need the server to be running to execute any SQL statements? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, but the service doesn't seem to be available immediately after start. There's a custom resource that waits until the tcp port is open and I think we should depend on that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes, that makes sense. Though with the newest versions (Fedora 38 with PostgreSQL 15) I see the systemd unit is Digging into this, it was introduced in postgres/postgres@7d17e68 so with PostgreSQL 9.6 it became possible to support. Looking at EL8 that's built with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
These seem to be the relevant bugs about this: |
||
["postgresqld_instance_#{self[:instance]}"] | ||
["postgresql::server::service::end::#{self[:instance]}"] | ||
end | ||
|
||
def should_run_sql(refreshing = false) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,10 @@ | |
status => $service_status, | ||
} | ||
|
||
Anchor["postgresql::server::service::begin::${name}"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may deeply regret asking when I do not have a full background on this but my understanding was Anchor was a redundant pattern as the contain function came in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes anchors are from the past. Not sure if attempting to remove them in this PR will help however (and that would be a backwards incompatible change). But in the long term, having them gone is probably a good idea. |
||
-> Service["postgresqld_instance_${name}"] | ||
-> Anchor["postgresql::server::service::end::${name}"] | ||
|
||
if $service_ensure in ['running', true] { | ||
# This blocks the class before continuing if chained correctly, making | ||
# sure the service really is 'up' before continuing. | ||
|
@@ -56,10 +60,13 @@ | |
sleep => 1, | ||
tries => 60, | ||
psql_path => $psql_path, | ||
require => Service["postgresqld_instance_${name}"], | ||
before => Anchor["postgresql::server::service::end::${name}"], | ||
} | ||
Postgresql::Server::Database <| title == $default_database |> -> Postgresql_conn_validator["validate_service_is_running_instance_${name}"] | ||
|
||
Anchor["postgresql::server::service::begin::${name}"] | ||
-> Service["postgresqld_instance_${name}"] | ||
-> Postgresql::Server::Database <| title == $default_database |> | ||
-> Postgresql_conn_validator["validate_service_is_running_instance_${name}"] | ||
-> Anchor["postgresql::server::service::end::${name}"] | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as an alternative, can we maybe autorequire the postgresql_conn_validator resource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That quite make sense. I'll dig into this.