Skip to content

Commit

Permalink
pgd: clarify joining nodes with non-default extensions (#6099)
Browse files Browse the repository at this point in the history
* pgd: clarify joining nodes with non-default extensions

If a node is joined with a user who does not have superuser permissions,
the presence of any extensions on the source node which require
superuser permissions to install, will cause the join operation to
fail.

Clarify that such extensions will need to be created manually on the
joining node if the user is not a superuser.

BDR-5519.

* Apply suggestions from code review

---------

Co-authored-by: Dj Walker-Morgan <[email protected]>
  • Loading branch information
ibarwick and djw-m authored Sep 26, 2024
1 parent ac521e0 commit b453e2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ The node that's joining the cluster must not contain any schema or data
that already exists on databases in the PGD group. We recommend that the
newly joining database be empty except for the BDR extension. However,
it's important that all required database users and roles are created.
Additionally, if the joining operation is to be carried out by a non-superuser,
extensions requiring superuser permission will need to be manually created. For
more details see [Connections and roles](../security/role-management#connections-and-roles).

Optionally, you can skip the schema synchronization using the
`synchronize_structure` parameter of the
Expand Down
15 changes: 15 additions & 0 deletions product_docs/docs/pgd/5/security/role-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ nodes, such that following stipulations are satisfied:
- It owns all database objects to replicate, either directly or from
permissions from the owner roles.

Additionally, if any non-default extensions (excluding the `bdr` extension
itself) are present on the source node, and any of these can only be installed
by a superuser, these extensions must be created manually (by a superuser) on
the join target node, otherwise the join process will fail.

In PostgreSQL 13 and later, extensions requiring superuser permission and which
therefore need to be manually installed, can be identified by executing (on the
source node):

```sql
SELECT name, (trusted IS FALSE AND superuser) AS superuser_only
FROM pg_available_extension_versions
WHERE installed AND name != 'bdr';
```

Once all nodes are joined, to continue to allow DML and DDL replication, you can reduce the permissions further to the following:

- The user has the `REPLICATION` attribute.
Expand Down

1 comment on commit b453e2c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Please sign in to comment.