Major-version upgrade preflight ignores `GetMemberData` error
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Read pkg/cluster/majorversionupgrade.go, especially the pod scan around line 156 and the later GetMemberData error check around line 215. Trace how failed Patroni reads affect replica logging and primary detection; done means the failure is handled clearly and a failed read cannot silently produce a false “no master” result. Add or update focused tests for these cases if the surrounding code has tests.
Written by the indexing model from the issue text.
Description
During the major-version upgrade check, majorVersionUpgrade ignores the error returned by c.patroni.GetMemberData(&pod) while scanning cluster pods, even though the same function checks GetMemberData errors a few lines later at line 215:
ps, _ := c.patroni.GetMemberData(&pod)
When the Patroni request fails in the pod loop, ps is a zero-value struct (State == "", Role == "", ServerVersion == 0), which causes two issues:
- If a replica read fails,
ps.Stateis"", so the operator logsidentified non running pod, potentially skipping major version upgradewithout showing that the Patroni request failed. - If the primary read fails,
masterPodis never set andc.currentMajorVersionis not updated from the primary, so the operator logsno master in the cluster(even when a healthy primary exists) and skips the upgrade withnilerror.
Is ignoring the error returned by GetMemberData at pkg/cluster/majorversionupgrade.go#L156 intentional, or should it be checked and logged/returned?
- Dominant language
- Go
- Stars
- 5.3k
- Forks
- 1.1k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zalando/postgres-operator
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zalando/postgres-operator#3257 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zalando/postgres-operator#3254 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zalando/postgres-operator#3252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
zalando/postgres-operator#3182 · 1 comment ·
Maintainers usually reply within 2 days
-
dependencies good first issue ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
zalando/postgres-operator#3132 · 3 comments ·
Maintainers usually reply within 2 days
All issues in zalando/postgres-operator
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pg-sharding/spqr#3314 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentPossibly taken @cvas22 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
influxdata/telegraf#20264 ·
Maintainers usually reply within 1 day
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameOpenaccepted bug wg/enterprise-environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#7483 · 1 comment ·
Maintainers usually reply within 1 day