Thread: Wal files in /pgsql/14/main/pg_wal not removed
Hi guys, and happy holidays.
My /pgsql/14/main/pg_wal directory is filling up. The server is not respecting the wal_keep_size = 100GB. I have no replication slots in this server, and I have already restarted PostgreSQL.
I don’t know what else to look for. Would appreciate any help.
My postgresql.conf can be found below:
data_directory = '/pgsql/14/main'hba_file = '/etc/postgresql/14/main/pg_hba.conf'ident_file = '/etc/postgresql/14/main/pg_ident.conf'external_pid_file = '/var/run/postgresql/14-main.pid'unix_socket_directories = '/var/run/postgresql'# SSLssl = onssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'listen_addresses = '*'port = 5432random_page_cost = 1.1max_connections = 400shared_buffers = 3840MBstatement_timeout = 0work_mem = 209719830kBmaintenance_work_mem = 960MBshared_preload_libraries = 'pg_stat_statements'pg_stat_statements.track = alltrack_activity_query_size = 102400synchronous_commit = offsynchronous_standby_names = '*'wal_buffers = 16MBwal_level = replica# PG 14 new parametersmin_wal_size = 1GBmax_wal_size = 4GBmax_worker_processes = 2max_parallel_workers_per_gather = 1max_parallel_workers = 2max_parallel_maintenance_workers = 1# Replication parametersmax_replication_slots = 15hot_standby_feedback = onhot_standby = onfsync = onwal_keep_size = 100GBrestore_command = 'cp /data/wal_archive/%f %p'checkpoint_completion_target = 0.9archive_mode = onarchive_command = '/pgsql/pg-archive-wal-to-slaves.sh "%p"'archive_timeout = 300max_wal_senders = 50effective_cache_size = 11520MBlogging_collector = onlog_directory = '/data/postgresql/log'log_filename = 'postgresql.log.%a'log_rotation_age = 1440log_rotation_size = 0log_truncate_on_rotation = onlog_min_duration_statement = 1000log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h 'log_lock_waits = onlog_statement = 'ddl'log_timezone = 'UTC'stats_temp_directory = '/var/run/postgresql/main.pg_stat_tmp'autovacuum = onlog_autovacuum_min_duration = 1000autovacuum_max_workers = 5autovacuum_naptime = 40sautovacuum_vacuum_threshold = 200autovacuum_analyze_threshold = 150autovacuum_vacuum_scale_factor = 0.02autovacuum_analyze_scale_factor = 0.005datestyle = 'iso, mdy'timezone = 'UTC'lc_messages = 'en_US.UTF-8'lc_monetary = 'en_US.UTF-8'lc_numeric = 'en_US.UTF-8'lc_time = 'en_US.UTF-8'default_text_search_config = 'pg_catalog.english'deadlock_timeout = 2smax_files_per_process = 4096effective_io_concurrency = 200default_statistics_target = 100max_standby_streaming_delay = 30s
Thanks!
Lucas
Lucas <root@sud0.nz> writes: > My /pgsql/14/main/pg_wal directory is filling up. The server is not respecting the wal_keep_size = 100GB. I have no replicationslots in this server, and I have already restarted PostgreSQL. > I don’t know what else to look for. Would appreciate any help. > archive_mode = on > archive_command = '/pgsql/pg-archive-wal-to-slaves.sh "%p"' You have archive_mode on, so WAL files will not be removed until your archive_command reports success. Poke around in what that's doing. regards, tom lane
> On 27/12/2021, at 5:14 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Lucas <root@sud0.nz> writes: >> My /pgsql/14/main/pg_wal directory is filling up. The server is not respecting the wal_keep_size = 100GB. I have no replicationslots in this server, and I have already restarted PostgreSQL. >> I don’t know what else to look for. Would appreciate any help. > >> archive_mode = on >> archive_command = '/pgsql/pg-archive-wal-to-slaves.sh "%p"' > > You have archive_mode on, so WAL files will not be removed until > your archive_command reports success. Poke around in what that's > doing. > > regards, tom lane Thanks for your reply. I removed my script and set an archive_command with a sample cp and it’s working now. Indeed my script has some issues. Thanks again! Lucas