我有一个Postgresql 9.4.4的生产环境。从3周开始,我在pg_log中收到了很多消息。
<:::2020-04-06 23:59:59 BRT::2020-04-06 23:59:55 BRT:72350>|LOG: automatic vacuum of table "template0.pg_catalog.pg_range": index scans: 0
pages: 0 removed, 1 remain
tuples: 0 removed, 6 remain, 0 are dead but not yet removable
buffer usage: 20 hits, 0 misses, 0 dirtied
avg read rate: 0.000 MB/s, avg write rate: 0.000 MB/s
system usage: CPU 0.00s/0.00u sec elapsed 0.00 sec
<:::2020-04-07 00:00:00 BRT::2020-04-06 23:59:59 BRT:72428>|WARNING: oldest xmin is far in the past
<:::2020-04-07 00:00:00 BRT::2020-04-06 23:59:59 BRT:72428>|HINT: Close open transactions soon to avoid wraparound problems.
警告在一天中发生了很多次,而且看起来像是发生在template0.pg_catalog的每个表的真空状态。
在其他堆栈溢出的问题中搜索,我找到了很多答案,但都不符合我的情况。
他们说这可能是3种情况。
运行 从pg_stat_activity中选择*,其中state='idle in transaction'。LOG: automatic ...
I stopped the replication and dropped the replication slot.When I did this, the pg_subtrans was cleanned up, and the warning disappeared.
Everything is working normally now. Thanks guys!准备交易交易尚未关闭
slot_name;plugin;slot_type;datoid;database;active;xmin;catalog_xmin;restart_lsn
replica;;physical;;;t;2845561097;;584C/CC6604F0
跑步
My server:
autovacuum = on
archive_mode = on
wal_keep_segments = 20
max_wal_senders = 3
max_replication_slots = 3
wal_level = hot_standby
hot_standby = on
archive_command = 'test -f %p && cp %p /opt/postgres/archxlog/%f'
select * from pg_prepared_xacts;
standby_mode = 'on'
primary_conninfo = 'user= host= port= sslmode=disable sslcompression=1'
primary_slot_name = 'replica'
,我得到了9行,并完成了每个人与ROLLBACK PREPARED'gid';。所以,我现在没有任何准备好的事务。
未使用的复制槽
我只有一行,而这个复制在另一台服务器上使用。
所以,我不能放弃这台服务器,因为它正在使用。我的两台服务器都在正常运行,除了日志中的这些消息。我的recovery.conf(在另一台服务器上,有备用复制)。谢谢你的帮助!
ls -lha | more
total 1,4G
drwx------. 2 postgres postgres 92K Abr 27 10:56 .
drwx------. 19 postgres postgres 4,0K Fev 21 16:38 ..
-rw------- 1 postgres postgres 256K Dez 11 11:07 A99B
-rw------- 1 postgres postgres 256K Dez 11 11:07 A99C
-rw------- 1 postgres postgres 256K Dez 11 11:07 A99D
-rw------- 1 postgres postgres 256K Dez 11 11:07 A99E
EDIT.我在谷歌上搜索,我发现了这个问题,我的恢复.conf(在另一台服务器上,有备用复制):谢谢你的帮助!
在谷歌上搜索,我发现这个网站。pg_subtrans
文件夹,我创立了很多这么旧的文件。我的复制大约是今年2月的。所以,这些文件不是最近的。如何清除这个文件夹是最好的方法?
我有一个postgresql 9.4.4的生产环境。自3周以来,我在pg_log中收到了很多消息。