apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.07k stars 167 forks source link

[Improvement] configure unknown parameter for postgresql will let the cluster start failed #6504

Open ldming opened 8 months ago

ldming commented 8 months ago
kbcli version
Kubernetes: v1.26.3
KubeBlocks: 0.8.0
kbcli: 0.8.0
  1. create a postgresql cluster
    kbcli cluster create postgresql mypg --mode=replication
  2. wait cluster running
  3. configure an unknown parameter
    kbcli cluster configure mypg --config-spec postgresql-configuration --config-file postgresql.conf --set wal_keep_size_1=100
  4. restart the cluster
    kbcli cluster restart mypg
  5. cluster is always updating
    
    k get pods
    NAME                READY   STATUS    RESTARTS   AGE
    mypg-postgresql-0   4/5     Running   0          11m
    mypg-postgresql-1   4/5     Running   0          11m

check the logs:

2024-01-20 06:27:40,428 INFO: Lock owner: None; I am mypg-postgresql-1 2024-01-20 06:27:40,428 INFO: starting as a secondary 2024-01-20 06:27:40,432 WARNING: Removing unexpected parameter=wal_keep_size_1 value=100 from the config 2024-01-20 06:27:40.583 GMT [548] LOG: unrecognized configuration parameter "wal_keep_size_1" in file "/home/postgres/conf/postgresql.conf" line 260 2024-01-20 06:27:40.583 GMT [548] FATAL: configuration file "/home/postgres/conf/postgresql.conf" contains errors 2024-01-20 06:27:40,589 INFO: postmaster pid=548

sophon-zt commented 7 months ago

It is currently a relatively conservative strategy. Unrecognized parameters are ignored. Otherwise, all parameters need to be configured in cue, otherwise the verification will fail. Typical ones are configurations in plugins, such as adviser.* parameters.

index_adviser.enable_log = 'on'
index_adviser.max_aggregation_column_count = '10'
index_adviser.max_candidate_index_count = '500'