pg_archivecleanup命令对复制插槽有效吗?

发布于 2025-01-27 04:32:52 字数 301 浏览 4 评论 0原文

根据复制插槽的定义,它是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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我三岁 2025-02-03 04:32:52

当您运行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 using restore_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 the pg_wal directory), which are not affected by pg_archivecleanup. Now since the standby consumes WAL directly from the primary (as specified in primary_conninfo), it does not have to rely on the WAL archives.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文