Skip to content

Commit

Permalink
Merge pull request #5477 from EnterpriseDB/docs/pgd/fix/DOCS-304-crea…
Browse files Browse the repository at this point in the history
…te-notes-in-pgd-docs-where-users-will-require

First pass at adding permission notes to features (DOCS-304)
  • Loading branch information
djw-m authored Apr 17, 2024
2 parents e1b855a + 69a756f commit 728a29d
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Column-level conflict resolution requires the table to have `REPLICA IDENTITY FU

## Enabling and disabling column-level conflict resolution

!!! Note Permissions Required
Column level conflict detection uses the `column_timestamps` type. This requires the user to have have at least the [bdr_application](security/pgd-predefined-roles/#bdr_application) role assigned to them.
!!!

The [bdr.alter_table_conflict_detection()](conflicts#bdralter_table_conflict_detection) function manages column-level conflict resolution.

### Example
Expand Down
4 changes: 4 additions & 0 deletions product_docs/docs/pgd/5/consistency/crdt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ redirects:

Conflict-free replicated data types (CRDT) support merging values from concurrently modified rows instead of discarding one of the rows as traditional resolution does.

!!! Note Permissions Required
PGD CRDT require usage access to CRDT types, therefore a user must have at least the [bdr_application](security/pgd-predefined-roles/#bdr_application) role assigned to them.
!!!

Each CRDT type is implemented as a separate PostgreSQL data type with an extra callback added to the `bdr.crdt_handlers` catalog. The merge process happens inside the PGD writer on the apply side without any user
action needed.

Expand Down
6 changes: 6 additions & 0 deletions product_docs/docs/pgd/5/durability/camo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ If status of the transaction wasn't success or connection was bad, we check if t

### Working with the CAMO partner

!!! Note Permissions Required
A number of the following CAMO functions require permission. Any user wishing to use CAMO,
the user must have at least the [bdr_application](../security/pgd-predefined-roles/#bdr_application)
role assigned to them.
!!!

The function [`bdr.is_camo_partner_connected()`](/pgd/latest/reference/functions#bdris_camo_partner_connected) allows checking the connection status of a CAMO partner node configured in pair mode. There currently is no equivalent for CAMO used with Eager Replication.

To check that the CAMO partner is ready, use the function [`bdr.is_camo_partner_ready`](/pgd/latest/reference/functions#bdris_camo_partner_ready). Underneath, this triggers the switch to and from local mode.
Expand Down
20 changes: 13 additions & 7 deletions product_docs/docs/pgd/5/reference/functions-internal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,23 @@ Currently, row_filters are ignored by this function.
The `bdr.resynchronize_table_from_node` function can be executed only by
the owner of the table, provided the owner has bdr_superuser privileges.

### `bdr.seq_nextval`
### `bdr.seq_currval`

Internal implementation of sequence increments.
Part of the internal implementation of global sequence manipulation.

Use this function instead of standard `nextval` in queries that
interact with [PGD global sequences](../sequences/#pgd-global-sequences).
Invoked automatically when `currval()` is called on a galloc or snowflakeid sequence.

#### Notes
### `bdr.seq_lastval`

Part of the internal implementation of global sequence manipulation.

Invoked automatically when `lastval()` is called on a galloc or snowflakeid sequence.

### `bdr.seq_nextval`

Part of the internal implementation of global sequence increments.

The following are also internal PGD sequence manipulation functions.
`bdr.seq_currval` and `bdr.seq_lastval` are used automatically.
Invoked automatically when `nextval()` is called on a galloc or snowflakeid sequence

### `bdr.show_subscription_status`

Expand Down
2 changes: 2 additions & 0 deletions product_docs/docs/pgd/5/reference/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@
"bdrreset_relation_stats": "/pgd/latest/reference/functions-internal#bdrreset_relation_stats",
"bdrreset_subscription_stats": "/pgd/latest/reference/functions-internal#bdrreset_subscription_stats",
"bdrresynchronize_table_from_node": "/pgd/latest/reference/functions-internal#bdrresynchronize_table_from_node",
"bdrseq_currval": "/pgd/latest/reference/functions-internal#bdrseq_currval",
"bdrseq_lastval": "/pgd/latest/reference/functions-internal#bdrseq_lastval",
"bdrseq_nextval": "/pgd/latest/reference/functions-internal#bdrseq_nextval",
"bdrshow_subscription_status": "/pgd/latest/reference/functions-internal#bdrshow_subscription_status",
"bdrshow_workers": "/pgd/latest/reference/functions-internal#bdrshow_workers",
Expand Down
2 changes: 2 additions & 0 deletions product_docs/docs/pgd/5/reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ The reference section is a definitive listing of all functions, views and comman
* [`bdr.reset_relation_stats`](functions-internal#bdrreset_relation_stats)
* [`bdr.reset_subscription_stats`](functions-internal#bdrreset_subscription_stats)
* [`bdr.resynchronize_table_from_node`](functions-internal#bdrresynchronize_table_from_node)
* [`bdr.seq_currval`](functions-internal#bdrseq_currval)
* [`bdr.seq_lastval`](functions-internal#bdrseq_lastval)
* [`bdr.seq_nextval`](functions-internal#bdrseq_nextval)
* [`bdr.show_subscription_status`](functions-internal#bdrshow_subscription_status)
* [`bdr.show_workers`](functions-internal#bdrshow_workers)
Expand Down
15 changes: 7 additions & 8 deletions product_docs/docs/pgd/5/security/pgd-predefined-roles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,22 @@ EXECUTE privilege on:
- [`bdr.create_conflict_trigger`](/pgd/latest/reference/streamtriggers/interfaces#bdrcreate_conflict_trigger)
- [`bdr.create_transform_trigger`](/pgd/latest/reference/streamtriggers/interfaces#bdrcreate_transform_trigger)
- [`bdr.drop_trigger`](/pgd/latest/reference/streamtriggers/interfaces#bdrdrop_trigger)
- `bdr.get_configured_camo_partner`
- [`bdr.get_configured_camo_partner`](/pgd/latest/reference/functions#bdrget_configured_camo_partner)
- [`bdr.global_lock_table`](/pgd/latest/reference/functions#bdrglobal_lock_table)
- `bdr.is_camo_partner_connected`
- `bdr.is_camo_partner_ready`
- `bdr.logical_transaction_status`
- [`bdr.is_camo_partner_connected`](/pgd/latest/reference/functions#bdris_camo_partner_connected)
- [`bdr.is_camo_partner_ready`](/pgd/latest/reference/functions#bdris_camo_partner_ready)
- [`bdr.logical_transaction_status`](/pgd/latest/reference/functions#bdrlogical_transaction_status)
- `bdr.ri_fkey_trigger`
- [`bdr.seq_nextval`](/pgd/latest/reference/functions-internal#bdrseq_nextval)
- `bdr.seq_currval`
- `bdr.seq_lastval`
- [`bdr.seq_currval`](/pgd/latest/reference/functions-internal#bdrseq_currval)
- [`bdr.seq_lastval`](/pgd/latest/reference/functions-internal#bdrseq_lastval)
- [`bdr.trigger_get_committs`](/pgd/latest/reference/streamtriggers/rowfunctions#bdrtrigger_get_committs)
- [`bdr.trigger_get_conflict_type`](/pgd/latest/reference/streamtriggers/rowfunctions#bdrtrigger_get_conflict_type)
- [`bdr.trigger_get_origin_node_id`](/pgd/latest/reference/streamtriggers/rowfunctions#bdrtrigger_get_origin_node_id)
- [`bdr.trigger_get_row`](/pgd/latest/reference/streamtriggers/rowfunctions#bdrtrigger_get_row)
- [`bdr.trigger_get_type`](/pgd/latest/reference/streamtriggers/rowfunctions#bdrtrigger_get_type)
- [`bdr.trigger_get_xid`](/pgd/latest/reference/streamtriggers/rowfunctions#bdrtrigger_get_xid)
- `bdr.wait_for_camo_partner_queue`
- [`bdr.wait_for_camo_partner_queue`](/pgd/latest/reference/functions#bdrwait_for_camo_partner_queue)
- [`bdr.wait_slot_confirm_lsn`](/pgd/latest/reference/functions#bdrwait_slot_confirm_lsn)

Many of these functions require additional privileges before you can use them.
Expand All @@ -149,4 +149,3 @@ required to read the conflict history. If it's useful to have a user that can
see conflicts for all tables, you can optionally grant the role
bdr_read_all_conflicts to that user.


6 changes: 6 additions & 0 deletions product_docs/docs/pgd/5/sequences.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ produce values that are unique only on the local node. This is important because
unique ids generated by such sequences cause conflict and data loss by
means of discarded `INSERT` actions in multi-master replication.

!!! Note Permissions Required
PGD global sequences are on by default. This means that for any user to use sequences,
the user must have at least the [bdr_application](security/pgd-predefined-roles/#bdr_application)
role assigned to them.
!!!

## PGD global sequences

For this reason, PGD provides an application-transparent way to generate unique
Expand Down
6 changes: 6 additions & 0 deletions product_docs/docs/pgd/5/striggers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ data processing on the downstream/target node:

Together, these types of triggers are known as *stream triggers*.

!!! Note Permissions Required
Stream triggers are a PGD feature which requires
permission. Any user wishing to create or drop triggers must have at least the
[bdr_application](security/pgd-predefined-roles/#bdr_application) role assigned
to them. !!!

Stream triggers are designed to be trigger-like in syntax. They leverage the
PostgreSQL BEFORE trigger architecture and are likely to have similar
performance characteristics as PostgreSQL BEFORE Triggers.
Expand Down

0 comments on commit 728a29d

Please sign in to comment.