简体   繁体   中英

Postgres 9.6 -> 14 using pglogical, autovacuum not running

We're upgrading our Postgresql from 9.6 to 14, using pglogical (latest installed via yum). The replication is working fine without errors. What we are not seeing, however, is any autovacuum activity on the v14 database, even though we continue to see normal autovacuum activity on the v9.6 database. Also, strangely, the dead tuple counts do not change on the v14 database and are mostly 0. I did run VACUUM ANALYZE on the v14 database.

The command we are using to see autovacuum activity is SELECT relname, last_vacuum, last_autovacuum, last_autoanalyze FROM pg_stat_user_tables;

The command we are using to see dead tuple counts is SELECT relname, n_dead_tup FROM pg_stat_user_tables;

There's nothing in the logs except checkpoint notifications. Here is one line picked at random:

2022-09-22 11:59:46 PDT [2877]: [15846-1] user=,db=,app=,client= LOG: checkpoint complete: wrote 38220 buffers (0.9%); 0 WAL file(s) added, 0 removed, 17 recycled; write=269.923 s, sync=0.025 s, total=269.962 s; sync files=264, longest=0.007 s, average=0.001 s; distance=313936 kB, estimate=329901 kB

The v14 database is streaming to another v14 database acting as a replica.

Is this expected behavior?

I do not know what caused the autovacuum to not run, but I restarted the v14 node, and it immediately spun up some autovacuum processes and proceeded to work through the large backlog. The dead tuple counts now appear accurate as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM