AutoFailover downfalls and improvements
What is the motivation or use case for the change?
We are planning to use the operator as part of our applications deployment. It is critical that our application has high availability and reliability but the auto-failover feature that is currently in place does not provide this.
The following are some scenarios that are not supported:
When there is a problem with the PVC underneath the primary cluster:
Test that was done: I removed the PVC from the primary cluster What happened: Nothing. The primary cluster remained the same What was expected: Promote one of the replica clusters that had a PVC to primary
When there is a problem with the worker underneath the primary cluster:
Test that was done: I removed the worker node the primary cluster was running on What happened: Nothing. The primary cluster remained the same What was expected: Promote one of the replica clusters that was running on a worker that was still available to primary
Additional scenarios will be added if/when found
Describe the solution you'd like Mentioned in the "what was expected"
Please tell us about your environment:
- Operating System:
- Where is this running ( Local, Cloud Provider): Cloud Provider
- Storage being used (NFS, Hostpath, Gluster, etc):
- Container Image Tag: centos7-4.0.0
- PostgreSQL Version: 4.0.0
- Platform (Docker, Kubernetes, OpenShift): Kubernetes
- Platform Version: 1.13
Additional context failoverEnabled.txt
thanks, noted and will work on an implementation.
for my testing, could you provide the storage type (gce? ebs?) and also the command you used to delete the PVC? I'll give this a try today.
The environment was using IBM Block Storage.
The command used to remove the PVC kubectl delete pvc <name-of-pvc>
Sidenote: The finalizers needed to be removed from the PVC to allow for it's deletion
@jmccormick2001 It also must be added that Rook-ceph is also used in some of our environments too.
It's not strictly IBM block storage
some status...I did an initial test of killing the pvc/pv and the failover occurred...this was using storageos as the PV type and this was on k8s 1.15...the pod controller sees the not ready event and works as normal. I removed the finalizers from the pod/pvc/pv to get the PV to remove...I'll need to test this some more to see how to duplicate it. If you recreate it, I'd be curious to see your operator container log with debug turned on.
The pod does not go into a not ready state when the PVC is removed when I'm testing so the failover process will not work for me when I'm testing.
There doesn't seem to be any logs in the operator as the failover is not triggered as the pod doesn't go into the not ready state pvcRemove.txt
thanks, one test that would be good to run is 'exec' into the primary pod after you remove the PVC, and see if you can run 'psql'. The probe is essentially doing that so I'd be curious of what happens if you run 'select now()' manually.
The queries can still run successfully even though Kubernetes is telling me that the PVC is removed.
Not sure how it's still working and storing data without the PVC underneath.
When that pod is restarted it does not come back as it can't claim the previously deleted PVC which can be seen in failoverEnabled.txt above ^^.
Maybe it mightn't be a problem if it stills stores data and works
ok, that explains why the 'not ready' is not getting made...another test would be to see if you can insert/or create some data instead of just a 'select now()'....I've thought of making the probe also test for the existentence of "/pgdata/" using a 'ls /pgdata/somecluster', would also be curious if that errors out.
We tried creating a table and writing to it and it seems to work. /pgdata does seem to be getting written to so we are unsure why it is working.
weird for sure, not sure how I can catch that in the probe at the moment..I might try this with rook/ceph and see how it responds...maybe its how the storage is implemented, not sure.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.