Skip to content

SGCluster 2nd Replica not fully functioning

Summary

2nd replica of SGCluster Patroni container will not start correctly.

Current Behaviour

Have an SGCluster of 2 replicas. The first replica starts up fine and is functioning. The 2nd replica's patroni container will not start correctly. Looking at its logs I get the following.

+ for POSTGRES_BIN_FILE in "${PG_BIN_PATH}"/*
+ '[' '!' -f /usr/local/bin/vacuumdb ']'
+ for POSTGRES_BIN_FILE in "${PG_BIN_PATH}"/*
+ '[' '!' -f /usr/local/bin/vacuumlo ']'
+ PATRONI_POSTGRESQL_BIN_DIR=/usr/local/bin
+ exec exec-with-env patroni -- /usr/bin/patroni /etc/patroni/config.yml
postgresql parameter listen_addresses=localhost failed validation, defaulting to None
postgresql parameter port=5432 failed validation, defaulting to None

I have attempted to restart the SGCluster with no avail, this patroni container refuses to function correctly.

Steps to reproduce

Take any SGCluster with replicas of 2 with the following CRDS applied: SGInstanceProfile SGPoolingConfig SGPostgresConfig SGScript

Apply it so it starts up and is functioning, Delete the SGCluster, Apply the SGCluster without or minor changes (adding new postgres extensions as an example to the SGCluster definition). Repeat process until Patroni bug surfaces. In some cases I have seen the SGCluster start correctly with 2 replicas, and sometimes I see the bug. Its inconsistent.

Expected Behaviour

Functioning 2 replicas of an SGCluster

Possible Solution

no idea

Environment

  • StackGres version: 1.11
  • Kubernetes version: 1.22
  • Cloud provider or hardware configuration:

Relevant logs and/or screenshots

I see the following logs on the 2nd replica patroni container.

+ for POSTGRES_BIN_FILE in "${PG_BIN_PATH}"/*
+ '[' '!' -f /usr/local/bin/vacuumdb ']'
+ for POSTGRES_BIN_FILE in "${PG_BIN_PATH}"/*
+ '[' '!' -f /usr/local/bin/vacuumlo ']'
+ PATRONI_POSTGRESQL_BIN_DIR=/usr/local/bin
+ exec exec-with-env patroni -- /usr/bin/patroni /etc/patroni/config.yml
postgresql parameter listen_addresses=localhost failed validation, defaulting to None
postgresql parameter port=5432 failed validation, defaulting to None
Edited by Matteo Melli