Release Date: 2017-07-11
Fix for [pgpool-hackers: 2400] Garbage output (Muhammad Usama)
Mostly the log messages fixes and few code cleanups.
Importing the latest changes in the MemoryManager API from PostgreSQL code. (Muhammad Usama)
Fixing [pgpool-hackers: 2390]Problems with the relative paths in daemon mode (Muhammad Usama)
Adjust function name change in PostgreSQL 10 dev head. (Tatsuo Ishii)
pg_current_wal_location -> pg_current_wal_lsn pg_last_wal_replay_location -> pg_last_wal_replay_lsn
Fix a possible hang with streaming replication and extended protocol (Yugo Nagata)
This hang occurred under a certain condition. The following is an example.
- pgpool.conf is configured so that all read queries are sent to the standby. - First, issue a writing query in a transaction block - After commiting the transaction, issue a select query. - When processing the query, send Describe (statement) message just after Parse.
Without using JDBC, we can reproduce the problem by pgproto with the following messages.
'Q' "DROP TABLE IF EXISTS test_tbl" 'Y' 'Q' "CREATE TABLE test_tbl(i int)" 'Y' 'Q' "INSERT INTO test_tbl VALUES(1)" 'Y' 'P' "" "BEGIN" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "INSERT INTO test_tbl VALUES(1)" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "COMMIT" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "S_1" "SELECT * FROM test_tbl" 0 'D' 'S' "S_1" 'B' "C_1" "S_1" 0 0 0 'E' "C_1" 0 'S' 'Y' 'X'
To fix it,
parse_before_bind() should be called only if we are in a transaction block so that we can send Bind and Execute to the right backend.
Fix Pgpool-II hang when used by erlang applications. (Tatsuo Ishii)
Erlang client sends "Describe" message followed by "Flush". So the backend returns "Row description." However Pgpool-II forgets to reset the query in progress flag upon receiving "Row description" message, then Pgpool-II keeps on waiting for response from backend. This is the cause of erlang client hanging.
Fix is, just reset the query in progress flag upon receiving "Row description" message. Same thing can be said to "no data" message.
See [pgpool-general: 5555] for more details.
Fix bug with sending bind message to wrong target node. (bug 314) (Tatsuo Ishii)
Fix query cache hang when used by node.js. (Tatsuo Ishii)
See [pgpool-general: 5511] for more details.
Deal with PostgreSQL 10 in streaming replication delay checking. (Tatsuo Ishii)
Fix query cache memory leak. (Tatsuo Ishii)
Clearing cache buffers in case of no oid queries (like BEGIN, CHECKPOINT, VACUUM, etc) should have been done, but it did not.
Fix extended query hang in certain case. (Tatsuo Ishii)
errlang PostgreSQL API produces Parse ('P'), Describe ('D'), Flush ('H'), Bind ('B'), and Execute ('E'). Notice the 'H' message (this does not happen in JDBC. I suspect that's the reason why this problem is not popular before). After that, Pgpool-II dropped the extended query mode, it failed to find which backend to read data. Thus Pgpool-II simply tries to read all of backend which causes hang because it may have not send a message to some of backends.
Solution is, after receiving the flush message set doing extended query flag.
Fix corner case bug in Pgpool-II starting up. (Tatsuo Ishii)
It is possible that a failover request is accepted before primary node is searched. This leads Pgpool-II to a strange state: there's no primary node if the failed node was a primary node (even if new primary node exists as a result of promotion of existing standby).
See [pgpool-hackers: 2321] for more details.