Open Jabbl opened 4 years ago
The Patroni struct only allows you to specify the documented fields. Try to use the generic parameters
field under postgresql
key which is also passed to Patroni:
postgresql:
version: "11"
parameters:
use_pg_rewind: true
remove_data_directory_on_rewind_failure: true
remove_data_directory_on_diverged_timelines: true
By looking at the Patroni docs, I'm not sure if it will work for the two remove_...
parameters
It seems parameters:
is the wrong place to add these.
The operator complains about the bools it seems:
level=debug msg="skipping \"UPDATE\" event for the invalid cluster: json: cannot unmarshal bool into Go struct field PostgresqlParam.parameters of type string" cluster-name=patroni/patroni-cluster pkg=controller
Manifest at this point:
postgresql:
version: "11"
parameters:
use_pg_rewind: true
remove_data_directory_on_rewind_failure: true
remove_data_directory_on_diverged_timelines: true
parameters
is of type map[string]string
, so please quote the flags -> "true"
I now tried quoting them too, but you're probably right in that the remove_
parameters cannot be set via parameters
...
use_pg_rewind
seems to be defaulted to true
, so I'm unsure if that line helps anything.
Is there some other way to set values for the postgres-deployment? \ It would be nice to configure Patroni in such a way that it self-adjusts after loss and restore of the master.
Half my patroni-cluster recently had a power outage which the active master was affected by.
The master-role was successfully transferred to one of the slaves, but when the power came back the previous master refused to act as a slave, since the timelines had diverged by a couple seconds (the few values the master never got to send to it's slaves).
To fix this, I found the parameters
remove_data_directory_on_rewind_failure
andremove_data_directory_on_diverged_timelines
in the patroni documentation, and would like to enable these two.\ However, I have found no way of adding any of these parameters to thepostgres.yaml
.\ I've tried adding them under both theposgresql
andpatroni
top-level parameters in the cluster manifest, but none of them seems to have worked:Is there something I'm missing, or is there really no way of adding more
posgres.yml
-parameters through the operator?\ If there isn't, is this something that could be added?