Skip to content

K8SPG-779 | allow overriding wal_level#1439

Open
mayankshah1607 wants to merge 11 commits intomainfrom
K8SPG-779
Open

K8SPG-779 | allow overriding wal_level#1439
mayankshah1607 wants to merge 11 commits intomainfrom
K8SPG-779

Conversation

@mayankshah1607
Copy link
Member

CHANGE DESCRIPTION

Problem:
wal_level parameter is not configurable

Solution
Make wal_level configurable via dynamicConfiguration

For Doc/QA, note the following restriction from pg docs:

minimal WAL does not contain sufficient information for point-in-time recovery, so replica or higher must be used to enable continuous archiving (archive_mode) and streaming binary replication

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the PostgreSQL wal_level parameter configurable by moving it from Mandatory to Default parameters, allowing users to override it via spec.patroni.dynamicConfiguration.postgresql.parameters.

Changes:

  • Moved wal_level from Mandatory to Default parameter set to enable user configuration
  • Updated unit test expectations to reflect the parameter category change
  • Added comprehensive E2E test suite to verify dynamic configuration functionality

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/postgres/parameters.go Moved wal_level from Mandatory to Default parameters with updated comment explaining it can be overridden
internal/postgres/parameters_test.go Updated test expectations to verify wal_level is now in Default parameter set
e2e-tests/tests/dynamic-configuration/00-deploy-operator.yaml E2E test setup: deploys operator
e2e-tests/tests/dynamic-configuration/00-assert.yaml E2E test validation: verifies operator deployment
e2e-tests/tests/dynamic-configuration/01-create-cluster.yaml E2E test: creates PostgreSQL cluster
e2e-tests/tests/dynamic-configuration/01-assert.yaml E2E test validation: verifies cluster is ready with default configuration
e2e-tests/tests/dynamic-configuration/02-apply-configuration.yaml E2E test: applies dynamic configuration to override wal_level to "replica"
e2e-tests/tests/dynamic-configuration/03-verify.yaml E2E test: queries PostgreSQL to retrieve actual wal_level value
e2e-tests/tests/dynamic-configuration/03-assert.yaml E2E test validation: confirms wal_level was changed to "replica"
e2e-tests/tests/dynamic-configuration/99-remove-cluster-gracefully.yaml E2E test cleanup: removes cluster and operator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mayankshah1607 and others added 2 commits February 12, 2026 18:10
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
@mayankshah1607 mayankshah1607 marked this pull request as draft February 12, 2026 13:19
Copilot AI review requested due to automatic review settings February 12, 2026 13:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@egegunes egegunes added this to the v2.9.0 milestone Feb 12, 2026
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copilot AI review requested due to automatic review settings February 13, 2026 05:42
@mayankshah1607 mayankshah1607 marked this pull request as ready for review February 13, 2026 05:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
postgresql:
parameters:
wal_level: "replica"
restore_command: "exit 1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do we test with exit 1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't have any significance in this test, it is just to ensure that the default restore_command can be overridden

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use /bin/true for this, exit 1 might have unexpected consequences

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fixed

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copilot AI review requested due to automatic review settings February 13, 2026 09:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@JNKPercona
Copy link
Collaborator

Test Name Result Time
backup-enable-disable passed 00:06:30
builtin-extensions passed 00:05:12
custom-envs passed 00:18:25
custom-extensions passed 00:14:27
custom-tls passed 00:06:37
database-init-sql passed 00:02:06
demand-backup passed 00:25:03
dynamic-configuration passed 00:03:16
finalizers passed 00:04:08
init-deploy passed 00:02:46
huge-pages passed 00:02:49
monitoring passed 00:06:58
monitoring-pmm3 passed 00:08:18
one-pod passed 00:06:04
operator-self-healing passed 00:07:44
pitr passed 00:11:54
scaling passed 00:04:56
scheduled-backup passed 00:23:59
self-healing passed 00:08:30
sidecars passed 00:02:52
standby-pgbackrest passed 00:12:01
standby-streaming passed 00:09:15
start-from-backup passed 00:10:29
tablespaces passed 00:06:55
telemetry-transfer passed 00:03:44
upgrade-consistency passed 00:06:42
upgrade-minor passed 00:05:20
users passed 00:04:29
Summary Value
Tests Run 28/28
Job Duration 01:27:15
Total Test Time 03:51:43

commit: 1cee976
image: perconalab/percona-postgresql-operator:PR-1439-1cee9769c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants