Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

default_transaction_read_only is not set to on for standbys

オープン
#970 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
postgresql

調査の方向性

まず、target_session_attrs=read-writeを使用してスタンバイ上でPostgreSQL 13から15の動作を再現し、その後、SHOW transaction_read_onlyとSHOW default_transaction_read_only、および接続の起動パラメータを比較します。pg_auto_failoverがスタンバイセッションをどのように設定するかを追跡し、報告されたデフォルト値がスタンバイの状態と一致していることを、ALTER SYSTEMやpg_reload_conf()を手動で要求することなく確認します。

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

説明

bug good first issue

Moving from postgres 13 to 15 i bumped into an issue using target_session_attrs=read-write, where default_transaction_read_only would be off on standbys, resulting in clients connecting to the standby.

I have worked around it by switching target_session_attrs to primary instead of read-write which works for our case.

Now the weird thing is that show transaction_read_only returns on, but show default_transaction_read_only returns off. default_transaction_read_only also reports off in the connection startup parameters.

The reason it worked in postgres 13 is because postgres doesn't send default_transaction_read_only on startup so the client falls back to checking by show transaction_read_only.

If I call alter system set default_transaction_read_only to on and select pg_reload_conf() myself on the standbys they return on for default_transaction_read_only as expected.

主要言語
C
スター
1.4k
フォーク
143
平均マージ
9時間 30分
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

hapostgres/pg_auto_failover のほかの issue

hapostgres/pg_auto_failover の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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