[pgpool-general: 8952] pgpool-II 4.3 relationship with postgresql-12 and archive_cleanup_command off the primary PostgreSQL system

henri_pilon henri_pilon henri_pilon at bell.net
Mon Oct 23 23:04:08 JST 2023


My apologies if this question has been asked before , and  looking for 
some guidance.
 
Configuration  -  3 nodes cluster (primary and 2 standby systems)  with 
pgpool-II 4.3 and PostgreSQL 12
 
postgresql.conf off each systems. 
 
checkpoint_timeout = 30min
checkpoint_completion_target = 0.9
wal_buffers = 16MB
wal_level = replica
password_encryption = md5
archive_mode = on
archive_command = 'test ! -f /var/lib/pgsql/archivedir/%f && cp %p 
/var/lib/pgsql/archivedir/%f'
hot_standby = on
max_wal_senders = 10
wal_keep_segments = 10
port = 5432
wal_log_hints = on
restore_command = 'cp /var/lib/pgsql/archivedir/%f %p'
archive_cleanup_command = 'pg_archivecleanup /var/lib/pgsql/archivedir 
%r'
include_if_exists = '/var/lib/pgsql/12/data/myrecovery.conf'
 
I understand the pgpool-II myrecovery.conf overwriting the 
restore_command off each standby systems. 
physical slot replication is being utilize across the 2 standby systems, 
letting pgpool-II perform this configuration with the appropriate pcp 
command   
 
Our issue is that off the primary server the dedicate disk reserve for 
postgres keeps filling up, especially the /var/lib/pgsql/archivedir 
folder. 
 
My understanding the archive_cleanup_command action is only perform off 
the standby systems. 
 
The way we are currently are managing the issue is by  periodically 
performinf a pg_basebackup off the primary system to a backup folder and 
then performinnf the archive_cleanup_command manually looking for the 
.backup file in the archivedir  folder. 
 
#! /bin/sh
export PATH=/usr/local/pgsql/bin:${PATH}
ARCHDIR=/usr/local/pgsql/archive
LASTWALPATH=`/bin/ls $ARCHDIR/*.backup | /bin/sort –r | /usr/bin/head 
-1`
if [ $LASTWALPATH = '' ]; then
echo 'NO label file found.'
exit 1
fi
LASTWALFILE=`/bin/basename $LASTWALPATH`
pg_archivecleanup $ARCHDIR $LASTWALFILE
stat=$?
echo 'Archivelog cleanup complete'
exit $stat
 
I did several google search and unable to find nay relevant information 
around this subject in relation to pgpool-ii.  
 
What’s the proper way of managing the archivedir space off the primary 
system? 
 
What’s the best practice for this area and any guidance would be 
appreciated ? 
 
Thanks,
 
Henri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20231023/a834e303/attachment-0001.htm>


More information about the pgpool-general mailing list