Open possebon opened 6 months ago
@possebon Sorry for the late response.
Diagnosis: I created the pgtestdb to test using pgbench, but this database was not listed in .pgpass. The documentation states that the postgres user only needs to connect to the postgres database (I also added template1 to resolve the original error).
If you use other users in your scripts, you need to add those users in .pgpass.
Request for Clarification:
Is there a configuration detail I might be missing? How should data replication be managed in this scenario to maintain consistency across nodes?
In snapshot isolation mode, streaming replication is not used. Pgpool-II will replicate data to each node. (Pgpool-II executes the same queries on each PostgreSQL node.)
https://www.pgpool.net/docs/latest/en/html/runtime-config-running-mode.html
If you want to use streaming replication for data consistency, you can use Pgpool-II's streaming replication mode by setting backend_clustering_mode = 'streaming_replication'
Below is the configuration example: https://www.pgpool.net/docs/latest/en/html/example-cluster.html
Issues with recovery_2nd_stage Execution in PostgreSQL 14 and pgpool 4.5.2
Configuration:
Objective: Use load balancing for all SELECT queries
Documentation Reference: pgpool Documentation
Issue Description: I am configuring PostgreSQL 14 with pgpool 4.5.2 to load balance all SELECT queries. Following the documentation, I encountered an issue where the recovery_2nd_stage fails to execute correctly.
Observed Behavior: While debugging the configuration and logs, I found the following error:
Diagnosis: I created the pgtestdb to test using pgbench, but this database was not listed in .pgpass. The documentation states that the postgres user only needs to connect to the postgres database (I also added template1 to resolve the original error).
When recovery_2nd_stage fails, it does not execute the following promotion command:
Workaround: To avoid further errors when user databases are present, I modified the
.pgpass
file to use*
instead of specifying databases manually. This allowedpcp_recovery_node
to run smoothly (as recovery_2nd_stage completes successfully), but no replication slot appears when checking withSELECT * FROM pg_stat_replication
.Logs:
The PostgreSQL logs for the
pcp_recovery_node
process show no errors, indicating that everything ran successfully.Concerns:
recovery_2nd_stage
should not execute the promote command, as this causes the target node to assume it is the primary, leading to the disappearance of the replication slot.Request for Clarification: