pg_archivecleanup命令对复制插槽有效吗?
根据复制插槽的定义,它是PostgreSQL中的一个功能,可确保Master Server即使与服务器断开连接,Master Server也将保留复制品所需的WAL日志。
如果我每月15天运行pg_archivecleanup命令以释放我的存储空间,是否会有任何效果。它是否对复制插槽有任何影响,因为它正在追踪备用服务器所需的WAL文件?
因为我运行了pg_archivecleanup从上一个检查点删除WAL文件,但我不确定它是否正在删除其他副本所需的WAL文件。
如果不删除,那么它实际上是如何追踪它的?
我正在寻找专家的解释。
As per replication slot definition, it is a feature in PostgreSQL that ensure that the master server will retain the WAL logs that are needed by the replicas even when they are disconnected from server.
Is there any effect if I run pg_archivecleanup command every 15th day of month to free my storage. Does it has any effect on replication slot, since it is tracing WAL file which is required by standby server?
Because I run pg_archivecleanup removing WAL file from last checkpoint but I am not sure whether it is removing WAl file that is required for other replica.
If not removing then how it is actually tracing it?
I am looking for explanation from experts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您运行
PG_ARCHIVECLEANUP
时,PostgreSQL将删除所有比您指定为参数的WAL段更古老的WAL段。这将忽略复制插槽,您最终可能会删除待机服务器可能仍然需要的wal段来赶上(如果他们使用retherore_command
)。请注意,这通常不是问题,因为
pg_archivecleanup
从存档中删除WAL semgments ,而复制插槽与primary Server上的wal sengments ((在pg_wal
目录中,不受pg_archivecleanup
的影响。现在,由于备用待机会直接从主要中消耗WAL(如primary_conninfo
中指定),因此它不必依靠WAL档案。When you run
pg_archivecleanup
, PostgreSQL will delete all WAL segments that are older than the WAL segment you specify as argument. This will ignore replication slots, you you may end up removing WAL segments that may still be needed by standby servers to catch up (if they do that usingrestore_command
).Note that this normally not a problem, because
pg_archivecleanup
deletes WAL segments from the archive, while replication slots deal with WAL segments on the primary server (in thepg_wal
directory), which are not affected bypg_archivecleanup
. Now since the standby consumes WAL directly from the primary (as specified inprimary_conninfo
), it does not have to rely on the WAL archives.