pgpool-II 4.1.22 Documentation | |||
---|---|---|---|
Prev | Up | Appendix A. Release Notes | Next |
Release Date: 2023-05-18
Import psqlscan source code into Pgpool-II to judge multi statement query. (Tatsuo Ishii)
Psqlscan is a module in the PostgreSQL source tree. It is essentially subset of PostgreSQL SQL scanner but it is specialized for detecting the end of each SQL statement. Therefore we can count the number of SQL statements in a query string by using it.
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-February/04291.html Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-April/004320.html
Allow to use multiple statements extensively. (Tatsuo Ishii)
This commit tries to eliminate pgpool's long standing limitations regarding multiple statements (multi-statements).
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-February/004287.html
Use schema qualification for internal queries. (Tatsuo Ishii)
Some of objects such as function and cast did not use "pg_catalog." schema qualification. This does not lead to immediate security concern but using the schema qualification is always good practice.
Fix possible dead lock with shared relation cache. (Tatsuo Ishii)
When a user defined function obtains table locking, call to the function using extended query protocol could lead to dead lock. Here's a scenario:
(1) In session A client sends parse, bind, execute request for the function to pgpool.
(2) Pgpool-II in session A forwards the request to PostgreSQL.
(3) PostgreSQL in session A performs execute, resulting in a table lock.
(4) In session B client sends parse, bind, execute request for the function to pgpool.
(5) Pgpool in session B forwards the request to PostgreSQL.
(6) PostgreSQL in session B performs bind but the table was already locked by PostgreSQL in session A, and it waits for release of the lock.
(7) After pgpool in session B forwards the execute to PostgreSQL, it acquires semaphore to search shared relation cache to check the volatility of the function. Then it calls do_query and sends flush message to PostgreSQL to obtain the response from PostgreSQL up to this point. But since PostgreSQL is waiting for table lock in #6, pgpool has to wait for messages beyond bind complete.
(8) After pgpool in session A forwards the execute to PostgreSQL, it tries to acquire semaphore to search shared relation cache to check the volatility of the function but the semaphore was already acquired by pgpool in session B, it waits for the release of the semaphore.
(9) Session A and session B wait for each other, resulting in a dead lock.
To fix this, modify pool_search_relcache() so that it releases semaphore before calling do_query() (but acquires semaphore after do_query()). By this, session A in #8 above can get semaphore, and go forward. It receives sync message from client and forwards it to PostgreSQL. Upon receiving sync, the user defined function will finish the execution and releases the table lock. This makes PostgreSQL in session B move forward because now it can obtain the table lock.
Fix compile error on systems using musl libc. (bug 790) (Tatsuo Ishii)
Patch provided by leimaohui.
Fix multiple query cache bug. (Tatsuo Ishii)
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-January/004259.html
Fix sr worker to not send wrong query to standby server in corner case. (Tatsuo Ishii)
When ALWAYS_PRIMARY flag is set, PRIMARY_NODE_ID macro returns node id, rather than -1 even if the primary is down. In this case streaming replication delay check worker sends SELECT pg_current_wal_lsn() or SELECT pg_current_xlog_location() depending on PostgreSQL's version to standby which of course raises an error.
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-February/004279.html
Fix kind mismatch error with DEALLOCATE. (bug 780) (Tatsuo Ishii)
Kind mismatch error occurs when conditions below are all met:
streaming replication mode
load balance node is other than primary
PREPARE is used in a multi-statement query
Add explanation for wd_priority. (Chen Ningwei)
Add restriction regarding PREPARE/EXECUTE/DEALLOCATE. (Tatsuo Ishii)
Add caution to use -D option with pgpool. (Tatsuo Ishii)
Enhancing "Installation from RPM" section. (Bo Peng)
Remove the configuration of "-D" start OPTS from "8.2. Pgpool-II + Watchdog Setup Example". (Bo Peng)
Mention that AES256 support requires --with-openssl option. (Tatsuo Ishii)
Explicitly stat that it is -w option of pcp command is needed to use .pcppass. (Tatsuo Ishii)
Enhance SHOW POOL_CACHE. (Tatsuo Ishii)
Refactor 071.execute_and_deallocate/test.sh. (Tatsuo Ishii)
Enhance regression tests. (Tatsuo Ishii)
Fix occasional 005.jdbc test failure. (Tatsuo Ishii)