diff options
-rw-r--r-- | doc.ja/src/sgml/advanced.sgml | 12 | ||||
-rw-r--r-- | doc.ja/src/sgml/watchdog.sgml | 18 | ||||
-rw-r--r-- | doc/src/sgml/advanced.sgml | 24 | ||||
-rw-r--r-- | doc/src/sgml/watchdog.sgml | 10 | ||||
-rw-r--r-- | src/protocol/child.c | 5 | ||||
-rw-r--r-- | src/watchdog/wd_lifecheck.c | 11 |
6 files changed, 45 insertions, 35 deletions
diff --git a/doc.ja/src/sgml/advanced.sgml b/doc.ja/src/sgml/advanced.sgml index e240ae310..79407e016 100644 --- a/doc.ja/src/sgml/advanced.sgml +++ b/doc.ja/src/sgml/advanced.sgml @@ -190,7 +190,7 @@ <!-- <title>Changing active/standby state when certain fault is detected</title> --> - <title>障害が検出された際のアクティブ/スタンバイ状態の切換</title> + <title>障害が検出された際のリーダー/スタンバイ状態の切換</title> <indexterm zone="tutorial-watchdog-changing-active"> <primary>WATCHDOG</primary> @@ -204,7 +204,7 @@ by voting and change active/standby state. --> <productname>Pgpool-II</productname>の障害が検出されると、watchdogは他のwatchdogにそのことを通知します。 - 障害が起きたのがアクティブな<productname>Pgpool-II</productname>であれば、watchdogは投票によって新しいアクティブ<productname>Pgpool-II</productname>を決定し、active/standby状態を変更します + 障害が起きたのがリーダー<productname>Pgpool-II</productname>であれば、watchdogは投票によって新しいリーダー<productname>Pgpool-II</productname>を決定し、active/standby状態を変更します </para> </sect2> @@ -225,8 +225,8 @@ <productname>Pgpool-II</productname> to work using the same IP address even when servers are switched. --> - スタンバイ<productname>Pgpool-II</productname>サーバが昇格すると、新しいアクティブサーバは仮想IPインターフェイスを立ち上げます。 - 一方、以前のアクティブサーバは、仮想IPインターフェイスを停止します。 + スタンバイ<productname>Pgpool-II</productname>サーバが昇格すると、新しいリーダーサーバは仮想IPインターフェイスを立ち上げます。 + 一方、以前のリーダーサーバは、仮想IPインターフェイスを停止します。 これにより、サーバが切り替わっても<productname>Pgpool-II</productname>は同じIPアドレスを使うことができます。 </para> </sect2> @@ -784,7 +784,7 @@ --> クエリモードでは、PostgreSQLサーバの障害やpcp_detach_nodeによってすべてのDBノードが<productname>Pgpool-II</productname>から切り離されると、watchdogは<productname>Pgpool-II</productname>サービスが停止状態にあるとみなし、watchdogに割り当てられた仮想IPを停止します。 ですので、<productname>Pgpool-II</productname>のクライアントは仮想IPを使って<productname>Pgpool-II</productname>に接続できなくなります。 - これは、複数のアクティブ<productname>Pgpool-II</productname>が存在するスプリットブレインを回避するために必要です。 + これは、複数のリーダー<productname>Pgpool-II</productname>が存在するスプリットブレインを回避するために必要です。 </para> </sect2> @@ -844,7 +844,7 @@ brought down before a down notification packet is sent to other <productname>Pgpool-II</productname>. --> - 停止通知パケットが他の<productname>Pgpool-II</productname>に送られる前に、以前の仮想IPが停止したことを確認するので、アクティブ<productname>Pgpool-II</productname>が停止してからスタンバイ<productname>Pgpool-II</productname>が新しいアクティブに昇格するまでには数秒を要します。 + 停止通知パケットが他の<productname>Pgpool-II</productname>に送られる前に、以前の仮想IPが停止したことを確認するので、リーダー<productname>Pgpool-II</productname>が停止してからスタンバイ<productname>Pgpool-II</productname>が新しいリーダーに昇格するまでには数秒を要します。 </para> </sect2> </sect1> diff --git a/doc.ja/src/sgml/watchdog.sgml b/doc.ja/src/sgml/watchdog.sgml index b4eff8db6..1f314020e 100644 --- a/doc.ja/src/sgml/watchdog.sgml +++ b/doc.ja/src/sgml/watchdog.sgml @@ -407,8 +407,8 @@ Default is <literal>''</literal>(empty): which means virtual IP will never be brought up. --> - (アプリケーションサーバなど)クライアントサーバから接続される<productname>Pgpool-II</productname>の仮想IP(VIP) アドレスを指定します。 - <productname>Pgpool-II</productname>がスタンバイからアクティブに切り替わった時、<productname>Pgpool-II</productname>はこのVIPを引き継ぎます。 + (アプリケーションサーバなど)クライアントサーバから接続される<productname>Pgpool-II</productname>の仮想IP(VIP)アドレスを指定します。 + <productname>Pgpool-II</productname>がスタンバイからリーダーに切り替わった時、<productname>Pgpool-II</productname>はこのVIPを引き継ぎます。 <emphasis>クォーラムが存在しなければVIPは立ち上がりません</emphasis>。 デフォルトは<literal>''</literal>(空文字)で、この場合仮想IPは決して立ち上がりません。 </para> @@ -669,7 +669,7 @@ Configuration about behavior when <productname>Pgpool-II</productname> escalates to active (virtual IP holder) --> - <productname>Pgpool-II</productname>がアクティブ(仮想IPを保持しているステータス)に昇格した時の振る舞いを指定します。 + <productname>Pgpool-II</productname>がリーダー(仮想IPを保持しているステータス)に昇格した時の振る舞いを指定します。 </para> <variablelist> @@ -690,8 +690,8 @@ when pgpool-II escalates to active. This prevents the new active <productname>Pgpool-II</productname> from using old query caches inconsistences to the old active. --> - このオプションがonの場合、pgpool-II がアクティブに昇格した時に、共有メモリ上のクエリキャッシュを全て削除します。 - これにより、新しいアクティブの<productname>Pgpool-II</productname>が旧アクティブと非整合な古いクエリキャッシュを使うことを防止します。 + このオプションがonの場合、pgpool-II がリーダーに昇格した時に、共有メモリ上のクエリキャッシュを全て削除します。 + これにより、新しいリーダーの<productname>Pgpool-II</productname>が旧リーダーと非整合な古いクエリキャッシュを使うことを防止します。 </para> <para> <!-- @@ -881,11 +881,11 @@ </para> <para> - <productname>Pgpool-II </productname><emphasis>V4.1</emphasis>以後では、プライマリノードのフェイルオーバに関してwatchdogのリーダノードが合意形成に失敗し、その結果プライマリバックエンドが隔離状態になった場合、そのリーダノードはリーダ/コーディネータの役割を辞退し、次のリーダの選挙の際にwd_priorityを引き下げることにより、クラスタが新しいリーダを選ぶように仕向けます。 + <productname>Pgpool-II </productname><emphasis>V4.1</emphasis>以後では、プライマリノードのフェイルオーバに関してwatchdogのリーダーノードが合意形成に失敗し、その結果プライマリバックエンドが隔離状態になった場合、そのリーダーノードはリーダーの役割を辞退し、次のリーダーの選挙の際にwd_priorityを引き下げることにより、クラスタが新しいリーダーを選ぶように仕向けます。 <note> <para> - スタンバイバックエンドの障害時にリーダノードが合意形成に失敗した場合は、特にアクションは起こしません。 - watchdogリーダが管理する隔離されたスタンバイバックエンドは新しいリーダの選挙を引き起こしません。 + スタンバイバックエンドの障害時にリーダーノードが合意形成に失敗した場合は、特にアクションは起こしません。 + watchdogリーダが管理する隔離されたスタンバイバックエンドは新しいリーダーの選挙を引き起こしません。 </para> </note> </para> @@ -1105,7 +1105,7 @@ このパラメータがオンのときは、split-brainが発生するリスクがあることに注意してください。 たとえば、ノードA, B, C, Dからなる4ノードのクラスタでは、(A, B)と(C, D)の分断された2つのネットワークになる可能性があります。 (A, B)と(C, D)にとっては、それぞれ生きた2つのノードが存在するので、クォーラムは依然として存在します。 - 各々のグループはそれぞれのリーダwatchdogを選び、これはすなわちsplit-brainです。 + 各々のグループはそれぞれのリーダーwatchdogを選び、これはすなわちsplit-brainです。 </para> <para> デフォルト値はオフです。 diff --git a/doc/src/sgml/advanced.sgml b/doc/src/sgml/advanced.sgml index 74cf9f17a..7bfdd069a 100644 --- a/doc/src/sgml/advanced.sgml +++ b/doc/src/sgml/advanced.sgml @@ -129,7 +129,7 @@ </sect2> <sect2 id="tutorial-watchdog-changing-active"> - <title>Changing active/standby state when certain fault is detected</title> + <title>Changing leader/standby state when certain fault is detected</title> <indexterm zone="tutorial-watchdog-changing-active"> <primary>WATCHDOG</primary> @@ -137,9 +137,9 @@ <para> When a fault of <productname>Pgpool-II</productname> is detected, watchdog notifies the other watchdogs of it. - If this is the active <productname>Pgpool-II</productname>, - watchdogs decide the new active <productname>Pgpool-II</productname> - by voting and change active/standby state. + If this is the leader <productname>Pgpool-II</productname>, + watchdogs decide the new leader <productname>Pgpool-II</productname> + by voting and change leader/standby state. </para> </sect2> @@ -150,9 +150,9 @@ <primary>WATCHDOG</primary> </indexterm> <para> - When a standby <productname>Pgpool-II</productname> server promotes to active, - the new active server brings up virtual IP interface. Meanwhile, the previous - active server brings down the virtual IP interface. This enables the active + When a standby <productname>Pgpool-II</productname> server promotes to leader, + the new leader server brings up virtual IP interface. Meanwhile, the previous + leader server brings down the virtual IP interface. This enables the leader <productname>Pgpool-II</productname> to work using the same IP address even when servers are switched. </para> @@ -167,7 +167,7 @@ <para> When the broken server recovers or new server is attached, the watchdog process notifies this to the other watchdogs in the cluster along with the information of the new server, - and the watchdog process receives information on the active server and + and the watchdog process receives information on the leader server and other servers. Then, the attached server is registered as a standby. </para> </sect2> @@ -524,7 +524,7 @@ Thus clients of <productname>Pgpool-II</productname> cannot connect to <productname>Pgpool-II</productname> using the virtual IP any more. This is necessary to avoid split-brain, - that is, situations where there are multiple active + that is, situations where there are multiple leader <productname>Pgpool-II</productname>. </para> </sect2> @@ -561,9 +561,9 @@ <primary>WATCHDOG</primary> </indexterm> <para> - After the active <productname>Pgpool-II</productname> stops, + After the leader <productname>Pgpool-II</productname> stops, it will take a few seconds until the standby <productname>Pgpool-II</productname> - promote to new active, to make sure that the former virtual IP is + promote to new leader, to make sure that the former virtual IP is brought down before a down notification packet is sent to other <productname>Pgpool-II</productname>. </para> @@ -640,7 +640,7 @@ <listitem> <para> - Manages the Virtual-IP on the active/coordinator node and + Manages the Virtual-IP on the leader/coordinator node and allow the users to provide custom scripts for escalation and de-escalation. </para> diff --git a/doc/src/sgml/watchdog.sgml b/doc/src/sgml/watchdog.sgml index 86812ce32..6c8074984 100644 --- a/doc/src/sgml/watchdog.sgml +++ b/doc/src/sgml/watchdog.sgml @@ -283,7 +283,7 @@ pgpool_port2 = 9999 <productname>Pgpool-II</productname> that is connected from client servers (application servers etc.). When a <productname>Pgpool-II</productname> is switched from standby to - active, the <productname>Pgpool-II</productname> takes over this + leader, the <productname>Pgpool-II</productname> takes over this VIP. <emphasis>VIP will not be brought up in case the quorum does not exist</emphasis>. Default is <literal>''</literal>(empty): which means virtual IP will never be brought up. @@ -449,7 +449,7 @@ pgpool_port2 = 9999 <para> Configuration about behavior when <productname>Pgpool-II</productname> - escalates to active (virtual IP holder) + escalates to leader (virtual IP holder) </para> <variablelist> @@ -463,8 +463,8 @@ pgpool_port2 = 9999 <listitem> <para> When set to on, watchdog clears all the query cache in the shared memory - when pgpool-II escalates to active. This prevents the new active <productname>Pgpool-II</productname> - from using old query caches inconsistent to the old active. + when pgpool-II escalates to leader. This prevents the new leader <productname>Pgpool-II</productname> + from using old query caches inconsistent to the old leader. </para> <para> Default is on. @@ -626,7 +626,7 @@ pgpool_port2 = 9999 <para> From <productname>Pgpool-II </productname><emphasis>V4.1</emphasis> onward, if the watchdog-leader node fails to build the consensus for primary backend node failover and the primary backend node gets into a - quarantine state, then it resigns from its leader/coordinator responsibilities and lowers its wd_priority + quarantine state, then it resigns from its leader responsibilities and lowers its wd_priority for next leader election and let the cluster elect some different new leader. <note> <para> diff --git a/src/protocol/child.c b/src/protocol/child.c index cf2161806..87de2caac 100644 --- a/src/protocol/child.c +++ b/src/protocol/child.c @@ -772,8 +772,11 @@ read_startup_packet(POOL_CONNECTION *cp) } /* The database defaults to their user name. */ - if (sp->database == NULL || sp->database[0] == '\0') + if (sp->database == NULL) + sp->database = pstrdup(sp->user); + else if (sp->database[0] == '\0') { + pfree(sp->database); sp->database = pstrdup(sp->user); } diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index b62a9b493..5830d82af 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -642,7 +642,14 @@ load_watchdog_nodes_from_json(char *json_data, int len) json_value_free(root); } - +/*---------- + * is_wd_lifecheck_ready + * + * Check all registered watchdog nodes and returns WD_OK if: + * query mode: wd_ping_pgpool returns WD_OK + * hearbeat mode: has received from and + * sent to all node the heartbeat message + */ static int is_wd_lifecheck_ready(void) { @@ -680,7 +687,7 @@ is_wd_lifecheck_ready(void) { ereport(DEBUG1, (errmsg("watchdog checking life check is ready"), - errdetail("pgpool:%d at \"%s:%d\" has not send the heartbeat signal yet", + errdetail("pgpool:%d at \"%s:%d\" has not received from or sent to the heartbeat signal yet", i, node->hostName, node->pgpoolPort))); rtn = WD_NG; } |