cloudnative-pg / cloudnative-pg/plugin-barman-cloud

[Bug] Plugins are always used to archive WAL files if they have the capability

未关闭
#797 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Go
星标
191
派生
72
平均合并
1 天 16 小时
30 天内合并 PR
18

描述

`isWALArchiver` is ignored and [plugins are always used to archive WAL files](https://github.com/cloudnative-pg/cloudnative-pg/blob/3f2626d709c24ffdb3fb325e2fb09861d816467c/pkg/management/postgres/archiver/archiver.go#L298) if they have the capability to do it.

Given the following plugins stanza:

```yaml
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: false
parameters:
serverName: cnpg-default
barmanObjectName: cnpg-default-barman
```

You would expect WAL not to be archived using this plugin. However, there is no filtering in the [archiveWALViaPlugins](https://github.com/cloudnative-pg/cloudnative-pg/blob/3f2626d709c24ffdb3fb325e2fb09861d816467c/pkg/management/postgres/archiver/archiver.go#L277). It always archives with plugins that support WAL archiving.

The only cases where it won't archive WAL are:

1. if you specify a plugin as the WAL archiver and it doesn't have that capability.
2. you don't specify any plugins

贡献指南

打开贡献指南

调研方向

从 pkg/management/postgres/archiver/archiver.go 开始,重点查看 archiveWALViaPlugins 以及 isWALArchiver 的处理。复现 isWALArchiver: false 的 YAML 情况,并验证 WAL 不会通过该插件进行归档;当显式设置得到遵守,同时具备能力的插件在启用后仍然可以进行归档时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
go, postgresql
领域
backend, databases
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。