zalando / zalando/postgres-operator

Delayed update of `PostgresClusterStatus` when pods in error state

Open
#2,101 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? e.g. v1.7
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? vmware tanzu k8s
  • Are you running Postgres Operator in production? yes
  • Type of issue? Bug report

When the postgres cluster pods go in error state (ImagePullBackOff,CreateContainerConfigError etc) because of changes in k8s environment, the custom resource postgresql does not get updated with the error state and shows the status as Running when in real it's not running.

This could be because here there is no check if the cluster is actually in running state or not. It would be helpful to update the right status of the cluster.

The status get updated only during the next sync, which might be very long time before setting the error status (SyncFailed or similar).

Replicating the issue:

Create a cluster by applying minimum custom resource. Edit something so the pod goes in to error state like updating the image version on pod to something that doesn't exist. Pod would go in to one of the error state. Check the status of postgresql, and it would be showing as Running

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at pkg/cluster/cluster.go around line 252 and reproduce the issue by creating a cluster, changing a pod image to an invalid value, and observing its error state. Check how the postgresql custom resource status is derived and updated during sync. Done means the resource reports the pod or cluster error promptly instead of remaining Running until a later sync.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
databases, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.