[pgpool-general-jp: 136] DBIx::Class::Schemaから接続した場合に、縮退モードに入らない

hoshiba hisanari hoshiba @ jp.fujitsu.com
2007年 5月 26日 (土) 02:06:14 JST


こんにちは。
干場と申します。

 pgpool version 3.2をレプリケーションモードで動作させております。

 現在、データベースに不整合が発生し、縮退運転を期待しているタイミングで
動作が変わらない現象が発生しています。

 Catalyst+DBIx::Class::Schemaの環境で、接続環境は以下の通りです。

                ┌ postgresql(master)  ┐
  Web1─ pgpool ┤                       ├pgpool-Web2
                └ postgresql(secondary) ┘


 Webとpgpoolは、同一サーバで動作させております。
 postgresは、master/secondaryを各々別のサーバで動作させており、4台の
構成になります。


 Web1が縮退モードに入った後、データを更新
 Web2が当該データを参照すると、データ不整合が検出される。
 この時点で、問題となるSQLを発行している、pgpoolの子プロセスのみが再起動
される。
 psqlコマンドで、show pool_statusを実行すると、 replication_enabledが1の
ままになっている。

 pgpoolの設定が誤っているのかと思いましたが、同一SQLをpsql→pgpoolで発行
すると、
ERROR:  kind mismatch between backends
HINT:  check data consistency between master and secondary
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
 を出力する。
 この状態で、show pool_statusを実行すると、 replication_enabledが0になり、
縮退モードに以降している事が確認できる。

 元々、縮退の原因になった、Web1およびpgpoolを再起動した上で、不整合がおき
たSQLを実行すると、Web2と同様に1つの子プロセスの再起動が発生し、縮退運転
には入らない

 Webアプリでアクセスした場合のpgpoolには、以下のログが出力されます。

2007-05-26 00:22:12 DEBUG: pid 22061: bind message: portal_name  stmt_name dbdpg_8
2007-05-26 00:22:12 DEBUG: pid 22061: read kind from frontend D(44)
2007-05-26 00:22:12 DEBUG: pid 22061: read kind from frontend E(45)
2007-05-26 00:22:12 DEBUG: pid 22061: Execute: portal name <>
2007-05-26 00:22:12 DEBUG: pid 22061: waiting for backend completing the query
2007-05-26 00:22:12 DEBUG: pid 22061: waiting for backend completing the query
2007-05-26 00:22:12 ERROR: pid 22061: read_kind: kind does not match between backends master(68) secondary(67)
2007-05-26 00:22:12 ERROR: pid 22061: Execute: pool_read_kind error
2007-05-26 00:22:12 LOG:   pid 22061: do_child: exits with status 1 due to error
2007-05-26 00:22:12 DEBUG: pid 22051: reap_handler called
2007-05-26 00:22:12 DEBUG: pid 22051: child 22061 exits with status 256 by signal 0
2007-05-26 00:22:12 DEBUG: pid 22051: fork a new child pid 22100
2007-05-26 00:22:12 DEBUG: pid 22100: I am 22100

 psqlコマンドでアクセスした場合は、以下のログが出力されます。
2007-05-26 00:19:44 DEBUG: pid 21970: pool_process_query: kind from backend: D
2007-05-26 00:19:44 ERROR: pid 21970: pool_process_query: kind does not match between backends master(D) secondary(C)
2007-05-26 00:19:44 LOG:   pid 21970: notice_backend_error: master: 0 fail over request from pid 21970
2007-05-26 00:19:44 DEBUG: pid 21969: failover_handler called
2007-05-26 00:19:44 LOG:   pid 21969: starting degeneration. shutdown secondary host 164.69.50.53(5432)
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21970
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21971
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21972
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21973
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21974
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21975
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21976
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21977
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21978
2007-05-26 00:19:44 DEBUG: pid 21969: kill 21979
2007-05-26 00:19:44 DEBUG: pid 21971: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21974: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21972: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21976: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21973: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21978: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21975: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21977: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21979: child receives shutdown request signal 3
2007-05-26 00:19:44 DEBUG: pid 21992: I am 21992
2007-05-26 00:19:44 DEBUG: pid 21992: I am 21992 accept fd 6
2007-05-26 00:19:44 DEBUG: pid 21992: Protocol Major: 3 Minor: 0 database: fjid user: common
2007-05-26 00:19:44 DEBUG: pid 21993: I am 21993
2007-05-26 00:19:44 DEBUG: pid 21994: I am 21994
2007-05-26 00:19:44 DEBUG: pid 21996: I am 21996
2007-05-26 00:19:44 DEBUG: pid 21995: I am 21995
2007-05-26 00:19:44 DEBUG: pid 21997: I am 21997
2007-05-26 00:19:44 DEBUG: pid 21998: I am 21998
2007-05-26 00:19:44 DEBUG: pid 21999: I am 21999
2007-05-26 00:19:44 LOG:   pid 21969: degeneration done. shutdown secondary host 164.69.50.53(54322007-05-26 00:19:44 DEBUG: pid 22000: I am 22000
)

OS
Web pgpool 				Solaris10(SPARC)
postgresql				Solaris10(SPARC)

postgresql 				8.2.3
pgpool 					3.2
perl 					5.8.8
Apache					2.0.59
DBIx::Class::Schema		0.03009


pgpoolの設定は以下の通りです。
 num_init_children            | 10         
 child_life_time              | 300        
 connection_life_time         | 0          
 child_max_connections        | 0          
 max_pool                     | 3          
 replication_mode             | 1          
 replication_strict           | 1          
 replication_timeout          | 5000       
 load_balance_mode            | 0          
 weight_master                | 0.500000   
 weight_secondary             | 0.500000   
 replication_stop_on_mismatch | 1          
 master_slave_mode            | 0          
 connection_cache             | 1          
 health_check_timeout         | 20         
 health_check_period          | 0          
 health_check_user            | nobody     
 insert_lock                  | 0          
 replication_enabled          | 1          
 master_slave_enabled         | 0          
 num_reset_queries            | 3          
 enable_pool_hba              | 0          


 何か問題点があるようでしたら、ご指摘お願いいたします。




pgpool-general-jp メーリングリストの案内