pgpool-II 4.7.0 Documentation
Prev | Up | Appendix A. Release Notes | Next

# A.3. Release 4.6.4

> Release Date: 2025-11-25

## A.3.1. Changes

- Remove unnecessary `application_name` treatment. (Tatsuo Ishii)

  A previous commit added a step to set `application_name` when reusing existing connections. However, this is unnecessary because DISCARD ALL automatically resets `application_name`, and `send_params()` already sends all necessary parameter status messages, including `application_name`, to the frontend. Removing this redundant step also improves performance, particularly for backend nodes that are geographically distant.

  Discussion: Severely degraded performance of pgPool in geo-distributed configurations

- Make time calculations always long long. (Tatsuo Ishii)

  Previously, Pgpool-II treated time_t as a simple long, which caused compile-time warnings on some systems, such as OpenBSD, where time_t is __int64. This change upcasts the calculations to long long, preventing truncation and ensuring pgpool continues to work correctly after Y2038 on 64-bit clean time_t systems. Additionally, json_get_long_value_for_key has been changed to json_get_llong_value_for_key with a long long parameter, aligning it with _json_value's int64 type. This improves integer handling on 32-bit platforms and helps avoid potential integer overflow issues.

  Problem analyzed by Tatsuo Ishii and Gyorgy Sarvari.

  Discussion: Fix time_t warnings on OpenBSD

  Discussion: Fix time_t warnings on OpenBSD

  Discussion: fix compiling issues for 32-bit targets

- Allow to compile against gcc 15 (C23). (Tatsuo Ishii)

  This change includes several fixes to compile Pgpool-II on Fedora 42 with gcc 15 (C23). It updates pool_type.h to use stdbool.h and defines TRUE/FALSE as (bool) 1/0, aligning with C99 standards. Function pointer arguments were corrected to match their prototypes, and `pool_create_relcache()`'s prototype was updated. Calls to `walker()` in `raw_expression_tree_walker()` were adjusted to cast the first argument to (Node *) via the WALK macro. Note that OpenSSL warnings on Fedora 42 remain and will be addressed in the future.

  Discussion: 4.6.X build issue against GCC 15

## A.3.2. Bug fixes

- Fix segfault with `CopyOut`. (Tatsuo Ishii)

  When `COPY relname TO STDOUT` is executed in the extended query protocol mode, pgpool segfaulted.

  This problem is reported by https://github.com/tetesh.

  Discussion: datanymizer and pg-pool segmentation fault

- Prevent watchdog split-brain scenario in some corner cases. (Tatsuo Ishii)

  Watchdog uses both beacon messages and heartbeat for communication. If the heartbeat is not yet active, missing beacon messages for over 30 seconds can cause a split-brain scenario, where the old leader remains active while a new leader is elected. This change prevents two leaders from existing simultaneously by revoking the old leader. When a node detects that it has missed beacon messages from the leader more than twice, the leader is set to LOST and a new leader election is triggered via set_state(WD_JOINING).

- Prevent FATAL error when non-existing prepared statement is given. (Tatsuo Ishii)

  Previously, `Bind()` raised a FATAL error when a non-existing prepared statement was used, unlike PostgreSQL. This change changes `Bind()` to check for the statement's existence and send an ERROR message to the frontend if it does not exist. Note that no log is written, as logging this is not currently possible.

- Fix pg_enc not working if both -p and -P are provided. (Tatsuo Ishii)

  The original report showed that running pg_enc -p -P prompted for a password and encryption key, but failed if the key was not provided.

  Discussion: pg_enc

- Fix compiling issue on 32-bit environments. (Tatsuo Ishii)

  On 32-bit systems, compiling src/parser/snprintf.c fails due to undefined functions `isnan()` and `isinf()`, which come from math.h. This change includes math.h and also reorders the include files for clarity. The file was originally imported from PostgreSQL, where math.h was already included. This fix was provided via pull request: https://github.com/pgpool/pgpool2/pull/128

  Discussion: Compiling issues for 32-bit targets

- Fix safer directory deletion in Bash in recovery_1st_stage.sample. (Taiki Koshino)

  Quote variables in rm commands to avoid accidental deletion: `rm -rf "${DEST_NODE_PGDATA}"` If the variable is empty, rm could delete unexpected files or directories.

- Fix point less warning in query cache invalidation. (Tatsuo Ishii)

  When memcached support is disabled, query cache invalidation by query emitted point less warning. This makes 006.memcached regression test failed.

- Fix the compilation error when building without the `--with-memcached` option. (Tatsuo Ishii)

  A compiler error occurred when configuring without `--with-memcached`. The issue arose because the compiler could not determine that ptr would only be freed when memcached is enabled. To fix this, the relevant code block was wrapped with #ifdef USE_MEMCACHED.

  Problem reported by Bo Peng.

- Fix query cache lock file handling. (Tatsuo Ishii)

  The query cache module creates a lock file in `logdir` for concurrency control, but two bugs existed: the main pgpool process could create a stray "QUERY_CACHE_LOCK_FILE", and the lock file was not removed on shutdown. This change fixes both issues.

  Problem reported and analyzed by Bo Peng.

## A.3.3. Documents

- Update doc about "Setting up PostgreSQL standby" in 8.2. Pgpool-II + Watchdog Setup Example. (Taiki Koshino)

  Add a note that when setting up a standby without online recovery, do not write `primary_conninfo` to postgresql.auto.conf.

  Discussion: Follow primary command not fixing postgresql.auto.conf

- Fix watchdog_setup manual. (Tatsuo Ishii)

  It mistakenly stated that heartbeart is not setup in watchdog_setup.

## A.3.4. Regression Tests

- Adapt 023.ssl_connection to PostgreSQL 18. (Tatsuo Ishii)

  PostgreSQL 18 heavily changed psql's \conninfo output format, which made the test fail because the test relies on \conninfo. This change makes the test script aware the PostgreSQL version to fix the issue.

- Unbreak 039.log_backend_messages. (Tatsuo Ishii)

  Commit 8ff2b9f6e mistakenly put synchronous commit parameters in pgpool.conf. Unbreak the test by putting the parameters in postgresql.conf. Also check if clustering mode is streaming replication. Because that parameters causes suspends PostgreSQL if clustering mode is other than streaming replication.

- Stabilize 039.log_backend_messages test. (Tatsuo Ishii)

  In the test a query is sent to standby server right after rows are inserted into primary server. Due to a replication lag, the inserted rows could not be found on the standby in slower machines. This change tries to fix the issue by using synchronous replication with `remote_apply` option.

- Fix ruby script in 010.rewrite_timestamp. (Tatsuo Ishii)

  The ruby script used "File.exists", which is said to be obsoleted in newer version of Ruby. Replace it with "File.exist".

- Tweak timeout in 034 and 075 tests. (Tatsuo Ishii)

  034.promote_node and 075.detach_primary_left_down_node set the timeout 60 seconds for finishing follow primary script. It turns out that these timeout values are not long enough, and sometimes caused false errors. So make them from 60 seconds to 120 seconds.

- Add ssl_ecdh_curve test to 023.ssl_connection. (Tatsuo Ishii)

  023.ssl_connection did not cover the test for ssl_ecdh_curve. This commit tests it using bad ssl_ecdh_curve parameter to see if connection between frontend and pgpool fails.

Prev | Home | Next
Release 4.6.5 | Up | Release 4.6.3