You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have the problem that all db cluster replicas are permanently recreated by the operator after a certain amount of time. We have figured out that the problem is a changing pod spec within the db cluster statefulsets:
In concrete terms the order of our with sidecar_docker_images globally configured sidecars (in our case filebeat + Postgres exporter) permanently changes within the pod spec.
of the operatorconfiguration CR should be the problem here. We are no Go experts but we figured out that the merging of global and cluster specific sidecars by the function mergeSidecars() occurs in a random order. Because in our case we have no cluster specific sidecars in cluster manifests configured we could notice this behavior in the for loop that iterates over global sidecars (OpConfig.Sidecars):
We have the problem that all db cluster replicas are permanently recreated by the operator after a certain amount of time. We have figured out that the problem is a changing pod spec within the db cluster statefulsets:
In concrete terms the order of our with
sidecar_docker_images
globally configured sidecars (in our case filebeat + Postgres exporter) permanently changes within the pod spec.We spent some time on analyzing https://github.com/zalando/postgres-operator/blob/master/pkg/cluster/k8sres.go and our assumption is that the map
sidecar_docker_image
postgres-operator/pkg/util/config/config.go
Line 114 in a1f2bd0
operatorconfiguration
CR should be the problem here. We are no Go experts but we figured out that the merging of global and cluster specific sidecars by the functionmergeSidecars()
occurs in a random order. Because in our case we have no cluster specific sidecars in cluster manifests configured we could notice this behavior in thefor
loop that iterates over global sidecars (OpConfig.Sidecars
):postgres-operator/pkg/cluster/k8sres.go
Line 1236 in 3c91bde
We have temporary hot fixed that issue by expanding the function
mergeSidecars()
postgres-operator/pkg/cluster/k8sres.go
Line 1220 in 3c91bde
result
before returning it. If interested I can share the fix.Is our assumption correct? What would be the more elegant solution here?
The text was updated successfully, but these errors were encountered: