Major-version upgrade preflight ignores `GetMemberData` error

オープン 初心者向け
#3,253 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, kubernetes, postgresql
領域
backend, databases

調査の方向性

pkg/cluster/majorversionupgrade.goを読み、特に156行目付近のPodスキャンと、215行目付近にある後続のGetMemberDataエラーチェックを確認してください。Patroniの読み取り失敗がレプリカのログ出力とプライマリの検出にどう影響するかを追ってください。失敗が明確に処理され、読み取り失敗によって誤った「masterなし」という結果が気づかれないまま生じない状態になれば完了です。周辺のコードにテストがある場合は、これらのケースに絞ったテストを追加または更新してください。

索引モデルが issue の本文から書いたものです。

説明

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:

  1. If a replica read fails, ps.State is "", so the operator logs identified non running pod, potentially skipping major version upgrade without showing that the Patroni request failed.
  2. If the primary read fails, masterPod is never set and c.currentMajorVersion is not updated from the primary, so the operator logs no master in the cluster (even when a healthy primary exists) and skips the upgrade with nil error.

Is ignoring the error returned by GetMemberData at pkg/cluster/majorversionupgrade.go#L156 intentional, or should it be checked and logged/returned?

主要言語
Go
スター
5.3k
フォーク
1.1k
平均マージ
3日 17時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zalando/postgres-operator のほかの issue

zalando/postgres-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。