[pgpool-general-jp: 125] Re: pgpool3.2+JDBC環境でのreplication_strictの挙動について

tutui-t @ sys.tosho.co.jp tutui-t @ sys.tosho.co.jp
2007年 5月 7日 (月) 19:24:44 JST


こんにちは、筒井です。

> テストスクリプトを作ったので、もし可能であれば添付したスクリプトを実行
> しても止まるかご確認いただけないでしょうか?手元ではデータの整合性がく
> ずれることなく終了しました。

いただいたスクリプトを実行したところ、
問題なく終了しました。
デッドロック、縮退運転などの発生はありません。
二回実行して、二回とも成功しています。

このスクリプト実行中にもpgpoolサーバのバックエンド側インターフェースで
tcp5432のパケットを取ってみたのですが、
同様に、MASTER、SECONDARYに連続してリクエストが投げられています。
その間にレスポンスのパケットが挟まっていると納得できるのですが。

一応、最初の部分だけログをお送りします。


pgpoolのデバッグログです。
---------------------------------------------------------------
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15759:
statement:  RESET ALL
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15759:
statement:  SET SESSION AUTHORIZATION DEFAULT
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15759:
statement: DEALLOCATE "S_1"
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15759:
statement: DEALLOCATE "S_2"
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15672:
statement:  RESET ALL
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15672:
statement:  SET SESSION AUTHORIZATION DEFAULT
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15672:
statement: DEALLOCATE "S_1"
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15672:
statement: DEALLOCATE "S_2"
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15659:
statement:  RESET ALL
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15659:
statement:  SET SESSION AUTHORIZATION DEFAULT
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15659:
statement: DEALLOCATE "S_1"
May  7 18:44:16 test_host pgpool: 2007-05-07 18:44:16 LOG:   pid 15659:
statement: DEALLOCATE "S_2"
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15658:
statement:  RESET ALL
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15658:
statement:  SET SESSION AUTHORIZATION DEFAULT
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15658:
statement: DEALLOCATE "S_1"
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15658:
statement: DEALLOCATE "S_2"
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15659:
statement:  RESET ALL
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15659:
statement:  SET SESSION AUTHORIZATION DEFAULT
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15659:
statement: DEALLOCATE "S_1"
May  7 18:44:17 test_host pgpool: 2007-05-07 18:44:17 LOG:   pid 15659:
statement: DEALLOCATE "S_2"


JDBCのデバッグログです。
---------------------------------------------------------------
18:44:14.563 (1) PostgreSQL 8.2 JDBC3 with SSL (build 505)
18:44:14.597 (1) Trying to establish a protocol version 3 connection to
192.168.0.25:5432
18:44:15.032 (1) PostgreSQL 8.2 JDBC3 with SSL (build 505)
18:44:15.082 (1)  FE=> StartupPacket(user=postgres, database=test_db,
client_encoding=UNICODE, DateStyle=ISO)
18:44:15.179 (1)  <=BE AuthenticationReqPassword
18:44:15.179 (1)  FE=> Password(password=<not shown>)
18:44:15.198 (1)  <=BE AuthenticationOk
18:44:15.541 (1)  <=BE ParameterStatus(client_encoding = UNICODE)
18:44:15.546 (1)  <=BE ParameterStatus(DateStyle = ISO, YMD)
18:44:15.546 (1)  <=BE ParameterStatus(integer_datetimes = off)
18:44:15.547 (1)  <=BE ParameterStatus(is_superuser = on)
18:44:15.547 (1)  <=BE ParameterStatus(server_encoding = EUC_JP)
18:44:15.547 (1)  <=BE ParameterStatus(server_version = 8.2.4)
18:44:15.548 (1)  <=BE ParameterStatus(session_authorization = postgres)
18:44:15.548 (1)  <=BE ParameterStatus(standard_conforming_strings = off)
18:44:15.549 (1)  <=BE ParameterStatus(TimeZone = Japan)
18:44:15.549 (1)  <=BE BackendKeyData(pid=514,ckey=1354547526)
18:44:15.550 (1)  <=BE ReadyForQuery(I)
18:44:15.550 (1)     compatible = 8.2
18:44:15.551 (1)     loglevel = 2
18:44:15.551 (1)     prepare threshold = 5
18:44:15.657 (1) Trying to establish a protocol version 3 connection to
192.168.0.25:5432
18:44:15.958 (1)  FE=> StartupPacket(user=postgres, database=test_db,
client_encoding=UNICODE, DateStyle=ISO)
18:44:15.965 (1)  <=BE AuthenticationReqPassword
18:44:15.966 (1)  FE=> Password(password=<not shown>)
18:44:15.974 (1)  <=BE AuthenticationOk
getConnection returning
driver[className=org.postgresql.Driver,org.postgresql.Driver @ 118f375]
18:44:16.248 (1)  <=BE ParameterStatus(client_encoding = UNICODE)
18:44:16.253 (1)  <=BE ParameterStatus(DateStyle = ISO, YMD)
18:44:16.253 (1)  <=BE ParameterStatus(integer_datetimes = off)
18:44:16.254 (1)  <=BE ParameterStatus(is_superuser = on)
18:44:16.254 (1)  <=BE ParameterStatus(server_encoding = EUC_JP)
18:44:16.255 (1)  <=BE ParameterStatus(server_version = 8.2.4)
18:44:16.255 (1)  <=BE ParameterStatus(session_authorization = postgres)
18:44:16.256 (1)  <=BE ParameterStatus(standard_conforming_strings = off)
18:44:16.256 (1)  <=BE ParameterStatus(TimeZone = Japan)
18:44:16.256 (1)  <=BE BackendKeyData(pid=515,ckey=487880795)
18:44:16.257 (1)  <=BE ReadyForQuery(I)
18:44:16.257 (1)     compatible = 8.2
18:44:16.258 (1)     loglevel = 2
18:44:16.258 (1)     prepare threshold = 5
18:44:16.328 (1) simple execute,
handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler @ 147c5fc,maxRows=0,
fetchSize=0, flags=5
18:44:16.332 (1)  FE=> Parse(stmt=S_1,query="BEGIN",oids={})
18:44:16.333 (1)  FE=> Bind(stmt=S_1,portal=null)
18:44:16.333 (1)  FE=> Execute(portal=null,limit=0)
18:44:16.337 (1)  FE=> Parse(stmt=null,query="LOCK TABLE up",oids={})
18:44:16.338 (1)  FE=> Bind(stmt=null,portal=null)
18:44:16.339 (1)  FE=> Describe(portal=null)
18:44:16.339 (1)  FE=> Execute(portal=null,limit=1)
18:44:16.339 (1)  FE=> Sync
18:44:16.428 (1)  <=BE ParseComplete [S_1]
18:44:16.429 (1)  <=BE BindComplete [null]
18:44:16.430 (1)  <=BE CommandStatus(BEGIN)
18:44:16.430 (1)  <=BE ParseComplete [null]
18:44:16.431 (1)  <=BE BindComplete [null]
18:44:16.431 (1)  <=BE NoData
18:44:16.431 (1)  <=BE CommandStatus(LOCK TABLE)
18:44:16.435 (1)  <=BE ReadyForQuery(T)
18:44:16.436 (1) simple execute,
handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler @ 161d36b,
maxRows=0, fetchSize=0, flags=5
18:44:16.437 (1)  FE=> Parse(stmt=null,query="UPDATE up SET a = a +
1",oids={})
18:44:16.437 (1)  FE=> Bind(stmt=null,portal=null)
18:44:16.437 (1)  FE=> Describe(portal=null)
18:44:16.438 (1)  FE=> Execute(portal=null,limit=1)
18:44:16.438 (1)  FE=> Sync
18:44:16.548 (1)  <=BE ParseComplete [null]
18:44:16.549 (1)  <=BE BindComplete [null]
18:44:16.549 (1)  <=BE NoData
18:44:16.549 (1)  <=BE CommandStatus(UPDATE 1)
18:44:16.550 (1)  <=BE ReadyForQuery(T)
18:44:16.554 (1) simple execute,
handler=org.postgresql.jdbc2.AbstractJdbc2Connection$TransactionCommandHandler @ 1ef8cf3,
maxRows=0, fetchSize=0, flags=22
18:44:16.555 (1)  FE=> Parse(stmt=S_2,query="COMMIT",oids={})
18:44:16.559 (1)  FE=> Bind(stmt=S_2,portal=null)
18:44:16.559 (1)  FE=> Execute(portal=null,limit=1)
18:44:16.559 (1)  FE=> Sync


以上です。


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