Repository navigation
Replies: 3 comments 9 replies
|
Can you please share the startDelay, stopDelay and switchoverDelay options you have? |
6 replies
|
Im still able to reproduce this behaviour.
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres-cluster
namespace: test
spec:
imageName: ghcr.io/cloudnative-pg/postgresql:15.1
instances: 3
minSyncReplicas: 2
maxSyncReplicas: 2
stopDelay: 1800
switchoverDelay: 3600
startDelay: 3600
storage:
storageClass: <your-storage-class>
size: 10Gi
affinity:
enablePodAntiAffinity: true
topologyKey: failure-domain.beta.kubernetes.io/zone
replicationSlots:
highAvailability:
enabled: true
updateInterval: 10
backup:
retentionPolicy: "30d"
barmanObjectStore:
destinationPath: s3://<your_s3_url>
endpointURL: https://<your_s3_endpoint>
s3Credentials:
accessKeyId:
name: s3-secret
key: ACCESS_KEY_ID
secretAccessKey:
name: s3-postgres-backup
key: SECRET_ACCESS_KEY
postgresql:
parameters:
shared_buffers: 256MB
max_connections: '200'
bootstrap:
initdb:
database: test_db
owner: test_user
secret:
name: postgresql-creds
import subprocess
DB_URL = "postgres://user:pw@localhost:5432/change-me"
def main():
query = "\dt"
result = subprocess.check_output(f"kubectl exec --namespace=change-me -it change-me-postgres-cluster-1 -- bash -c \"psql {DB_URL} -c '{query}'\"", shell=True)
if "test2" not in result.decode("utf-8"):
print("Database is empty")
print("creating test tables")
query = "CREATE TABLE test2 (id serial PRIMARY KEY, num integer);"
subprocess.call(f"kubectl exec --namespace=change-me -it change-me-postgres-cluster-1 -- bash -c \"psql {DB_URL} -c '{query}'\"", shell=True)
print("Database populated")
i = 0
while True:
query = f"INSERT INTO test(num) VALUES ({i});"
full_query = f"kubectl exec --namespace=change-me -it change-me-postgres-cluster-1 -- bash -c \"psql {DB_URL} -c '{query}'\""
print(full_query)
subprocess.call(f"kubectl exec --namespace=change-me -it change-me-postgres-cluster-1 -- bash -c \"psql {DB_URL} -c '{query}'\"", shell=True)
i += 1
print(f"Inserted {i} rows")
if __name__ == "__main__":
main()
kubectl delete -n change-me pod change-me-postgres-cluster-1 --grace-period=0 --forceNow one replica should become "file-based" and will loop wal recovery |
3 replies
|
I ran into a similar error. I suspect, that it was caused by a k3s upgrade plan where drain:-force was set. Can a |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey,
as outlined in #2800 if a replica is not able to replicate due to a timeline change it will loop WAL recovery but does not crash.
The Operator considers this replica as healthy as it is technically accepting connections and is running.
As documented in the codebase
proposals:
I'd love to get your thoughts on this and I'd be happy to help implement them :D.
All reactions