Skip to content

K8SPG-999: Fix dropping multiple custom extensions#1539

Open
matan77 wants to merge 4 commits intopercona:mainfrom
matan77:fix-drop-extensions
Open

K8SPG-999: Fix dropping multiple custom extensions#1539
matan77 wants to merge 4 commits intopercona:mainfrom
matan77:fix-drop-extensions

Conversation

@matan77
Copy link
Copy Markdown

@matan77 matan77 commented Apr 6, 2026

CHANGE DESCRIPTION

Problem:
The disableCustomExtensionsInDB() function exits prematurely when deleting multiple custom extensions because the return statement was inside the loop. Only the first extension is removed, leaving others installed and causing inconsistencies between the CR spec and the actual database state.

Cause:
The loop iterating over customExtensionsForDeletion contained a return statement, which caused early exit before all extensions could be processed.

Solution:
Moved the return statement outside the loop and restructured error handling to ensure all extensions are processed before returning. Added logging for each successfully disabled extension.

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? Not Relevant
  • Are all needed new/changed options added to the Helm Chart? Not Relevant
  • 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?

@it-percona-cla
Copy link
Copy Markdown

it-percona-cla commented Apr 6, 2026

CLA assistant check
All committers have signed the CLA.


log.V(1).Info("extension was disabled ", "extensionName", extensionName)
if err != nil {
return errors.Wrap(err, "custom extension deletion")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return errors.Wrap(err, "custom extension deletion")
return errors.Wrap(err, "drop extension")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think drop custom extension is a little bit better for the error to be more verbose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

makes sense

@egegunes egegunes added this to the v2.10.0 milestone Apr 6, 2026
@egegunes egegunes changed the title Fix drop extensions K8SPG-999: Fix dropping multiple custom extensions Apr 6, 2026
@matan77 matan77 requested a review from egegunes April 6, 2026 19:00
@matan77
Copy link
Copy Markdown
Author

matan77 commented Apr 7, 2026

made tha change

@JNKPercona
Copy link
Copy Markdown
Collaborator

Test Name Result Time
backup-enable-disable passed 00:12:33
builtin-extensions passed 00:05:34
cert-manager-tls passed 00:08:41
custom-envs passed 00:18:55
custom-extensions passed 00:15:44
custom-tls passed 00:07:08
database-init-sql passed 00:02:09
demand-backup passed 00:25:42
demand-backup-offline-snapshot passed 00:14:08
dynamic-configuration passed 00:03:26
finalizers passed 00:03:26
init-deploy passed 00:02:44
huge-pages passed 00:02:37
major-upgrade-13-to-14 passed 00:10:48
major-upgrade-14-to-15 passed 00:09:48
major-upgrade-15-to-16 passed 00:11:16
major-upgrade-16-to-17 passed 00:09:38
major-upgrade-17-to-18 passed 00:08:26
ldap passed 00:03:41
ldap-tls passed 00:06:23
monitoring passed 00:07:56
monitoring-pmm3 passed 00:08:09
one-pod passed 00:05:56
operator-self-healing passed 00:10:56
pitr passed 00:12:34
scaling passed 00:05:17
scheduled-backup passed 00:26:41
self-healing passed 00:09:04
sidecars passed 00:02:42
standby-pgbackrest passed 00:21:14
standby-streaming passed 00:13:21
start-from-backup passed 00:11:10
tablespaces passed 00:06:35
telemetry-transfer passed 00:04:33
upgrade-consistency passed 00:06:43
upgrade-minor passed 00:07:20
users passed 00:04:46
Summary Value
Tests Run 37/37
Job Duration 16:05:43
Total Test Time 05:48:02

commit: f7654e5
image: perconalab/percona-postgresql-operator:PR-1539-f7654e512

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants