$Header: /cvsroot/pgpool/pgpool-II/TODO,v 1.18.2.1 2009/08/24 04:36:10 t-ishii Exp $ * General Subject: [Pgpool-general] Bug when using Pgpool and PQprepare From: denis@edistar.com To: pgpool-general@pgfoundry.org Date: Wed, 26 Aug 2009 18:23:20 +0200 #0 ReadyForQuery (frontend=0x810bb50, backend=0x810b310, send_ready=1) at pool_proto_modules.c:1202 #1 0x080586e4 in SimpleForwardToFrontend (kind=69 'E', frontend=0x810bb50, backend=0x810b310) at pool_process_query.c:1871 #2 0x08058d58 in SimpleForwardToBackend (kind=66 'B', frontend=0x810bb50, backend=0x810b310) at pool_process_query.c:2069 #3 0x08078f61 in ProcessFrontendResponse (frontend=0x810bb50, backend=0x810b310) at pool_proto_modules.c:1505 #4 0x080551d2 in pool_process_query (frontend=0x810bb50, backend=0x810b310, connection_reuse=0, first_ready_for_query_received=0) at pool_process_query.c:308 #5 0x0804d935 in do_child (unix_fd=3, inet_fd=4) at child.c:427 #6 0x0804b62a in fork_a_child (unix_fd=3, inet_fd=4, id=0) at main.c:836 #7 0x0804cc93 in reaper () at main.c:1625 #8 0x0804d11d in pool_sleep (second=0) at main.c:1824 #9 0x0804ab73 in main (argc=6, argv=0xbf869a04) at main.c:588 (gdb) Preparing the statement... To backend> Msg P To backend> "" To backend> "INSERT INTO test_table (a) VALUES ($1)" To backend (2#)> 1 To backend (4#)> 0 To backend> Msg complete, length 51 To backend> Msg S To backend> Msg complete, length 5 To backend> Msg E To backend> "" To backend (4#)> 0 To backend> Msg complete, length 10 To backend> Msg S To backend> Msg complete, length 5 From backend> E From backend (#4)> 88 From backend> S From backend> "ERROR" From backend> C From backend> "22P02" From backend> M From backend> "invalid input syntax for integer: "123.5"" From backend> F From backend> "numutils.c" From backend> L From backend> "106" From backend> R From backend> "pg_atoi" From backend> From backend> Z From backend (#4)> 5 From backend> Z From backend (#4)> 5 From backend> E From backend> n From backend (#4)> 4 message type 0x6e arrived from server while idle (n) From backend> I From backend (#4)> 4 message type 0x49 arrived from server while idle (I: EmptyQueryResponse) From backend> Z From backend (#4)> 5 message type 0x5a arrived from server while idle (Z) Error executing the statement... Error Message:ERROR: invalid input syntax for integer: "123.5" PostgreSQL¤Ī¾ģ¹ē ./a.out To backend> Msg Q To backend> "begin;" To backend> Msg complete, length 12 From backend> C From backend (#4)> 10 From backend> "BEGIN" From backend> Z From backend (#4)> 5 From backend> Z From backend (#4)> 5 From backend> T Preparing the statement... To backend> Msg P To backend> "" To backend> "INSERT INTO test_table (a) VALUES ($1)" To backend (2#)> 1 To backend (4#)> 0 To backend> Msg complete, length 51 To backend> Msg S To backend> Msg complete, length 5 From backend> 1 From backend (#4)> 4 From backend> Z From backend (#4)> 5 From backend> Z From backend (#4)> 5 From backend> T Executing the statement... To backend> Msg B To backend> "" To backend> "" To backend (2#)> 0 To backend (2#)> 1 To backend (4#)> 5 To backend> 123.5 To backend (2#)> 1 To backend (2#)> 0 To backend> Msg complete, length 24 To backend> Msg D To backend> P To backend> "" To backend> Msg complete, length 7 To backend> Msg E To backend> "" To backend (4#)> 0 To backend> Msg complete, length 10 To backend> Msg S To backend> Msg complete, length 5 From backend> E From backend (#4)> 88 From backend> S From backend> "ERROR" From backend> C From backend> "22P02" From backend> M From backend> "invalid input syntax for integer: "123.5"" From backend> F From backend> "numutils.c" From backend> L From backend> "106" From backend> R From backend> "pg_atoi" From backend> From backend> Z From backend (#4)> 5 From backend> Z From backend (#4)> 5 From backend> E Error executing the statement... Error Message:ERROR: invalid input syntax for integer: "123.5" To backend> Msg X To backend> Msg complete, length 5 - Add backend id to statement log so that we can know if pgpool does replication correctly - Show PostgreSQL backend process ids in process status - Prepare for changing postgresql.conf directives which produce 'S' message. Othewise we get: pool_process_query: 1 th kind S does not match with master or majority connection kind C ERROR: pid 26122: kind mismatch among backends. Possible last query was: "UPDATE branches SET bbalance = bbalance + -3820 WHERE bid = 1;" kind details are: 0[C] 1[S] It seems PostgreSQL sends following parameter status at the *first* pgpool.conf reload only. 2009-02-23 23:06:21 LOG: pid 5611: name: is_superuser value: on 2009-02-23 23:06:31 LOG: pid 5627: name: DateStyle value: ISO, MDY 2009-02-23 23:06:31 LOG: pid 5626: name: DateStyle value: ISO, MDY 2009-02-23 23:06:31 LOG: pid 5622: name: DateStyle value: ISO, MDY (this item was resolved in 2.2) - drop table should be in a transactin block? It is judged here: (this item was resolved in 2.2) POOL_STATUS start_internal_transaction(POOL_CONNECTION_POOL *backend, Node *node) { int i; /* if we are not in a transaction block, * start a new transaction */ if (TSTATE(backend) == 'I' && (IsA(node, InsertStmt) || IsA(node, UpdateStmt) || IsA(node, DeleteStmt) || IsA(node, SelectStmt))) example session log: 2009-01-09 00:22:20 JST t-ishii test 853 LOG: statement: begin; 2009-01-09 00:22:23 JST t-ishii test 853 LOG: statement: lock table t1; 2009-01-09 00:22:23 JST t-ishii test 853 LOG: unexpected EOF on client connection 2009-01-09 00:22:45 JST t-ishii test 860 LOG: statement: drop table t1; 2009-01-09 00:22:46 JST t-ishii test 860 LOG: unexpected EOF on client connection 2009-01-09 00:22:49 JST t-ishii test 877 LOG: statement: drop table t1; 2009-01-09 00:22:49 JST t-ishii test 877 ERROR: table "t1" does not exist 2009-01-09 00:22:49 JST t-ishii test 877 STATEMENT: drop table t1; ????????? 2009-01-09 00:22:23 JST t-ishii test 854 LOG: unexpected EOF on client connection 2009-01-09 00:22:46 JST t-ishii test 861 LOG: statement: drop table t1; 2009-01-09 00:22:46 JST t-ishii test 861 ERROR: cache lookup failed for constraint 1857934 2009-01-09 00:22:46 JST t-ishii test 861 STATEMENT: drop table t1; 2009-01-09 00:22:46 JST t-ishii test 861 LOG: could not send data to client: ??????????? 2009-01-09 00:22:46 JST t-ishii test 861 LOG: unexpected EOF on client connection 2009-01-09 00:22:49 JST t-ishii test 878 LOG: statement: drop table t1; 2009-01-09 00:22:49 JST t-ishii test 878 ERROR: cache lookup failed for constraint 1857934 2009-01-09 00:22:49 JST t-ishii test 878 STATEMENT: drop table t1; 2009-01-09 00:25:51 JST t-ishii test 878 LOG: statement: create table t1(i int); 2009-01-09 00:25:52 JST t-ishii test 878 ERROR: relation "t1" already exists 2009-01-09 00:25:52 JST t-ishii test 878 STATEMENT: create table t1(i int); 2009-01-09 00:25:52 JST t-ishii test 878 LOG: could not send data to client: ??????????? 2009-01-09 00:25:52 JST t-ishii test 878 LOG: unexpected EOF on client connection - BEGIN; BEGIN; causes: (this item was resolved in 2.2) ERROR: kind mismatch among backends 0[N] 1[E] detect_error() checks following NOTICE(ERRRO¤Ī25001 means /* SET TRANSACTION ISOLATION LEVEL must be called before any query */) WARNING: 25001: there is already a transaction in progress this will send an error query to abort a transaction. - regression failres: triggers ... FAILED test sanity_check ... FAILED portals ... FAILED test misc ... FAILED plpgsql ... FAILED largeobject ... FAILED test tablespace ... FAILED ======================== 7 of 114 tests failed. ======================== this happens when replication true, insert_lock true, replicate_select false, load_balance false. if replicate_select is true, prepared_xacts fails(because \d fails) and prepared transactio remain, which keep a lock on pg_class in access share mode. And alter table pg_class cannot obtain exclusive lock, which causes all SELECTs suspend and regression cannot contiunue. - Allow client encoding conversion. This was possible in pgpool-I - Allow special comment such as "/* STRICT */". This was possible in pgpool-I - Allow multi statement - Sometimes query is sent to a DB node despite its weight is 0 - Avoid cross pgpool process deadlock situation. This is a long standing problem since pgpool-II was born (pgpool-I avoids this by setting timeout) - Allow to stop PostgeSQL from pgpoolAdmin to make the on-line recovery more convenient. This requires something like pgpool_remote_stop to be specified in pgpool.conf. - If DISCARD ALL is specified in the reset_query_list and transaction is not closed when client disconnects, automatically issue ABORT before issuing DISCARD ALL - Add SSL support - Allow to specify queries issued when starting sessions - Audit functionality? - Make accept queue - Graceful shutdown, attach, detach * Query handling - Enhance DROP DATABASE handling (not disconnect all idle connections) * Replication - Allow per table replication - Allow per session level and query level load balancing - Allow replication of SEQUENCE - Allow replication of OID - Allow to specify functions to be replicated other than nextval(), setval() * On line recovery - Allow recovery_1st_stage_command to get PostgreSQL listen port, database cluster directory etc. info * Query cache - Cache invalidation * Parallel query - Performance enhance for more complex queries - Allow to handle transaction - Allow to handle extended queries - process alias in FROM clause db=# select * from data1 as d1 inner join data2 as d2 on d1.id=d2.id; ERROR: sql error DETAIL: ERROR: missing FROM-clause entry for table "d1" LINE 1: SELECT pool_parallel("SELECT d1.id, d1.aaaa, d1.bbbb... ^ 2008-03-11 10:28:17 LOG: pid 6186: statement: SELECT pool_parallel("SELECT d1.id, d1.aaaa, d1.bbbb, a.cccc FROM data1") - process USING clause in JOIN * Docs - Write libpcp API docs