PgBouncer Explanations - Legacy charm

Legacy charms

This page contains explanations regarding the legacy version of this charm. This includes clarification about Charmhub tracks, supported endpoints and interfaces, config options, and other important information.

Summary


Charm types: “legacy” vs. “modern”

There are two types of charms stored under the same charm name pgbouncer:

  1. Reactive charm in the channel latest/stable (called legacy)
  2. Ops-based charm in the channel 1/stable (called modern)

The legacy charm was a principal charm, while the modern charm is subordinated.

The legacy charm provided SQL endpoints db and db-admin (for the interface pgsql). The modern charm provides those old endpoints and a new endpoint database (for the interface postgresql_client). Read more details about the available endpoints and interfaces here.

Non-SQL legacy charm interfaces (e.g. hacluster, pgbouncer-extra-config, nrpe-external-master) are currently NOT supported by the modern charm. Contact us with your use cases for those interfaces!

Note: Please choose one endpoint to use. No need to relate all of them simultaneously!

Default track latest/ vs. track 1/

The default track will be switched from the latest to 1 soon. This is to ensure all new deployments use a modern codebase. We strongly advise against using the latest track, since a future charm upgrade may result in a PgBouncer version incompatible with an integrated application. Track 1/ guarantees a PgBouncer major version 1 deployment only. The track latest/ will be closed after all applications migrated from reactive to the ops-based charm.

How to migrate to the modern charm

The modern charm provides temporary support for the legacy interfaces:

Quick try: relate the current application with new charm using endpoint db (set the channel to 1/stable). No extra changes necessary:

  pgbouncer:
    charm: pgbouncer
    channel: 1/stable

Proper migration: migrate the application to the new interface postgresql_client. The application will connect PgBouncer using the data_interfaces library from data-platform-libs via the endpoint database.

Warning: In-place upgrades are NOT possible! The reactive charm cannot be upgraded to the operator-framework-based one. The second/modern charm application must be launched nearby and relations should be switched from the legacy application to the modern one.

How to deploy the legacy charm

Deploy the charm using the channel latest/stable:

  pgbouncer:
    charm: pgbouncer
    channel: latest/stable

Note: remove Charm store prefix cs: from the bundle. Otherwise the modern charm will be chosen by Juju (due to the default track will be pointing to 1/stable and not latest/stable). The common error message is: cannot deploy application "postgresql": unknown option "...".

Features supported by the modern charm

This section goes over the key differences in feature support and functionality between the legacy and modern charm.

Config options

The legacy charm config options were not moved to the modern charm, since the modern charm applies the best possible configuration automatically. Feel free to contact us about the PgBouncer config options.

Extensions

The legacy charm provided plugins/extensions through the relation (interface pgsql). This is NOT supported by the modern charm - neither through pgsql nor the postgresql_client interface.

To enable extensions on modern PgBouncer, enable them on PostgreSQL charm using the appropriate plugin_*_enable config option of the modern charm. The modern charm will then provide plugins support for both pgsql and postgresql_client interfaces.

Roles

In the legacy charm, the user could request roles by setting the roles field to a comma separated list of desired roles. This is NOT supported by the modern charm implementation of the legacy pgsql interface.

The same functionality is provided via the modern postgresql_client using “extra-user-roles”.

PostgreSQL versions

At the moment, the modern PgBouncer charms support relation to the modern Charmed PostgreSQL 14 (based on Jammy/22.04 series) only. Please contact us if you need different versions/series.

Architectures

Currently, the charm supports architecture amd64 and arm64 only. For more technical details, see the Supported architectures reference.

Report issues

The “legacy charm” (from latest/stable) is stored on Launchpad. Report legacy charm issues here.

The “modern charm” (from 1/stable) is stored on GitHub. Report modern charm issues here.

Do you have questions? Reach out to us!