diff --git a/doc.ja/src/sgml/restrictions.sgml b/doc.ja/src/sgml/restrictions.sgml index 052ec4ce4..a8dfe3722 100644 --- a/doc.ja/src/sgml/restrictions.sgml +++ b/doc.ja/src/sgml/restrictions.sgml @@ -531,6 +531,25 @@ + + target_session_attrs + + + libpqの接続パラメータtarget_session_attrsをany以外に設定してPgpool-IIに接続しないでください。 + target_session_attrsは、接続したいPostgreSQLの種別を指定して接続するホストを選択できるlibpqの機能です。 + たとえばtarget_session_attrs = primaryがlibpqで接続パラメータに指定されていると、libpqは接続時にPgpool-IIが返却するParameterStatusのin_hot_standbyの値がoffであるかどうかをチェックします。 + Pgpool-IIは常にメインサーバ(ダウンしていない一番ノード番号が小さいノード)の値を返します。 + たまたまノード0がメインノードでスタンバイであったとすると、libpq側にはin_hot_standby = onが返却され、期待していたin_hot_standby = offが返らないため、libpq側ではエラーになるでしょう。 + + + ノード0がメインノードかつスタンバイで、target_session_attrs = read-onlyならどうなるでしょう? + この場合、libpqは正常にPgpool-IIに接続できます。 + しかし、更新クエリを投げてもPgpool-IIがそのクエリをプライマリに振り分けてくれるため、エラーになりません。 + これはlibpqを使用するアプリケーションにとって、予期しない動作になるかもしれません。 + + + + diff --git a/doc/src/sgml/restrictions.sgml b/doc/src/sgml/restrictions.sgml index 39fdc7b4a..d7d559fe8 100644 --- a/doc/src/sgml/restrictions.sgml +++ b/doc/src/sgml/restrictions.sgml @@ -365,6 +365,27 @@ + + target_session_attrs + + + Do not set libpq's connection parameter target_session_attrs2 to other than any to connect to Pgpool-II. + target_session_attrs is a libpq's feature to select PostgreSQL to connect to by specifying its kind. + For example, if target_session_attrs is set to primary, libpq will check in_hot_standby ParameterStatus value while connecting to Pgpool-II to make sure that it is off. + Pgpool-II always returns the value of the main server (the smallest node id server which is not in down status). + If the node 0 is the main server and it's a standby by chance, libpq will receive in_hot_standby = on, which is not the expected value (in_hot_standby = off). Therefore it's treated as an error in libpq side. + + + What happens if target_session_attrs = read-only and + the node 0 is the main server and it's a standby? In this case libpq can + connect to Pgpool-II normally. However, even + if a write query is sent, it does not raise an error + as Pgpool-II redirects the query to + primary. This may be an unexpected behavior for libpq applications. + + + +