-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix patroni config updates #513
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
Conversation
fe4176b
to
2452cd5
Compare
Signed-off-by: Stephane Tang <hi@stang.sh>
2452cd5
to
066c669
Compare
Fixes zalando#501 Signed-off-by: Stephane Tang <hi@stang.sh>
Fixes zalando#447 Signed-off-by: Stephane Tang <hi@stang.sh>
066c669
to
d4faf3f
Compare
@FxKu - sorry I wasn't more active on this. I've just merged-back current |
9b8f387
to
7f5ca22
Compare
// patroni configuration is not always reflected on the StatefulSet as they have | ||
// different lifecycle (due to SPILO's implementation - see: issues#501) but they | ||
// still need to be updated via the Patroni REST API. | ||
if err := c.applyPatroniConfig(); err != nil { |
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.
is the intention here to update Patroni config in DCS on every Update
event even if the actual config did not change ?
} | ||
} | ||
|
||
config.Bootstrap.DCS.Slots = oldestKnownPatroniCfg.Slots |
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.
but at this point the cluster already exists and bootstrap options have no effect. why are we resetting it again ? to get the same stateful set spec ?
} | ||
|
||
func generateSpiloJSONConfiguration(pg *acidv1.PostgresqlParam, patroni *acidv1.Patroni, pamRoleName string, logger *logrus.Entry) (string, error) { | ||
func generateSpiloJSONConfiguration(pg *acidv1.PostgresqlParam, patroni *acidv1.Patroni, pamRoleName string, logger *logrus.Entry, isNewCluster bool, initialPatroniConfig string) (string, error) { |
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.
tests also need to be updated
pkg/cluster/k8sres_test.go:76:48: not enough arguments in call to generateSpiloJSONConfiguration
have (*"github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1".PostgresqlParam, *"github.com/zala
ndo/postgres-operator/pkg/apis/acid.zalan.do/v1".Patroni, string, *logrus.Entry)
want (*"github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1".PostgresqlParam, *"github.com/zala
ndo/postgres-operator/pkg/apis/acid.zalan.do/v1".Patroni, string, *logrus.Entry, bool, string)
This PR is fixing #447 and #501
Note: for the update path, when deploying this new version of
postgres-operator
, it will automatically re-apply patroni config that are set in the current cluster spec, without restarting the pods.