Skip to content

K8 spg 786 - #1734

Draft
nmarukovich wants to merge 4 commits into
mainfrom
K8SPG-786
Draft

K8 spg 786#1734
nmarukovich wants to merge 4 commits into
mainfrom
K8SPG-786

Conversation

@nmarukovich

Copy link
Copy Markdown
Contributor

CHANGE DESCRIPTION

Problem:
The operator drops the pg_cron extension from the database and destroys all
jobs stored in cron.job. This happens to users who install pg_cron as a custom
extension from their own storage. It also happens when a user moves pg_cron
from the custom list to the builtin flags.

Cause:
pgCron and setUser were plain bools. If the user did not set them, the
operator set them to false. So the operator cannot see the difference between
"the user did not ask for pg_cron" and "the user wants pg_cron removed", and it
runs DROP EXTENSION IF EXISTS pg_cron.

The custom extensions loop drops an extension as soon as it is removed from the
custom list, even if the user enabled the same extension as a builtin one.
pg_cron**Solution:**PGCronandSetUserare*boolnow: nil means the flag is not set and the operator leaves the extension alone, false means drop it, true means create it. We do not setfalse` for these two flags anymore. With nil we also do not add
pg_cron to shared_preload_libraries, so postgres does not restart.

The custom extensions loop does not drop an extension if the same extension is
enabled as a builtin one. Now a user can move pg_cron from the custom list to
the builtin flags and keep the data.

new upgrade e2e tests
custom-extensions and upgrade-minor were extended.

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?

@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
backup-enable-disable passed 00:17:36
builtin-extensions failure 00:06:06
cert-manager-tls passed 00:11:51
custom-envs passed 00:23:11
custom-tls passed 00:07:58
database-init-sql passed 00:02:55
demand-backup passed 00:30:09
demand-backup-offline-snapshot passed 00:17:48
dynamic-configuration passed 00:03:52
finalizers passed 00:04:21
init-deploy passed 00:03:39
huge-pages passed 00:03:07
major-upgrade-14-to-15 passed 00:11:02
major-upgrade-15-to-16 passed 00:10:34
major-upgrade-16-to-17 passed 00:15:42
major-upgrade-17-to-18 passed 00:09:05
ldap passed 00:03:56
ldap-tls passed 00:07:07
monitoring passed 00:10:11
monitoring-pmm3 passed 00:09:13
operator-upgrade-cert-manager passed 00:14:18
operator-upgrade-extensions passed 00:13:52
one-pod passed 00:06:13
operator-self-healing passed 00:10:29
pgbouncer-mtls passed 00:04:01
pitr passed 00:13:31
scaling passed 00:05:12
scheduled-backup passed 00:25:38
self-healing passed 00:10:05
sidecars passed 00:05:00
standby-pgbackrest passed 00:18:28
standby-streaming passed 00:15:33
start-from-backup passed 00:13:28
tablespaces passed 00:07:06
telemetry-transfer passed 00:05:10
upgrade-consistency passed 00:06:38
upgrade-minor passed 00:14:26
users passed 00:05:20
migration-from-crunchy-standby passed 00:20:50
migration-from-crunchy-pv passed 00:08:35
migration-from-crunchy-backup-restore passed 00:17:13
Summary Value
Tests Run 41/41
Job Duration 02:30:56
Total Test Time 07:30:48

commit: f70c061
image: perconalab/percona-postgresql-operator:PR-1734-f70c06151

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.

2 participants