Skip to content

Commit

Permalink
Merge pull request #6209 from EnterpriseDB/DOCS-1077-document-pgd-s-b…
Browse files Browse the repository at this point in the history
…dr_config-command-reference-only-

DOCS-1077 - Added bdr_config - reformatted node state table.
  • Loading branch information
djw-m authored Nov 7, 2024
2 parents f42f21c + d26e458 commit 519155b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 28 deletions.
1 change: 1 addition & 0 deletions product_docs/docs/pgd/5.6/reference/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
"list-of-node-states": "/pgd/5.6/reference/nodes#list-of-node-states",
"node-management-commands": "/pgd/5.6/reference/nodes#node-management-commands",
"bdr_init_physical": "/pgd/5.6/reference/nodes#bdr_init_physical",
"bdr_config": "/pgd/5.6/reference/nodes#bdr_config",
"bdralter_node_group_option": "/pgd/5.6/reference/nodes-management-interfaces#bdralter_node_group_option",
"bdralter_node_interface": "/pgd/5.6/reference/nodes-management-interfaces#bdralter_node_interface",
"bdralter_node_option": "/pgd/5.6/reference/nodes-management-interfaces#bdralter_node_option",
Expand Down
1 change: 1 addition & 0 deletions product_docs/docs/pgd/5.6/reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ The reference section is a definitive listing of all functions, views, and comma
* [List of node states](nodes#list-of-node-states)
* [Node-management commands](nodes#node-management-commands)
* [`bdr_init_physical`](nodes#bdr_init_physical)
* [`bdr_config`](nodes#bdr_config)


## [Node management interfaces](nodes-management-interfaces)
Expand Down
102 changes: 74 additions & 28 deletions product_docs/docs/pgd/5.6/reference/nodes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,27 @@
navTitle: Node management
title: Node management
indexdepth: 3
deepToC: true
---

## List of node states

- `NONE`: Node state is unset when the worker starts, expected to be set quickly
to the current known state.
- `CREATED`: `bdr.create_node()` was executed, but the node isn't a
member of any EDB Postgres Distributed cluster yet.
- `JOIN_START`: `bdr.join_node_group()` begins to join the local node to an
existing EDB Postgres Distributed cluster.
- `JOINING`: The node join has started and is currently at the initial sync phase,
creating the schema and data on the node.
- `CATCHUP`: Initial sync phase is completed. Now the join is at the last step
of retrieving and applying transactions that were performed on the upstream
peer node since the join started.
- `STANDBY`: Node join finished but hasn't yet started to broadcast changes.
All joins spend some time in this state, but if defined as a logical standby,
the node continues in this state.
- `PROMOTE`: Node was a logical standby and `bdr.promote_node` was just called to
move the node state to `ACTIVE`. These two `PROMOTE`states have to be coherent
to the fact that only one node can be with a state higher than `STANDBY` but
lower than `ACTIVE`.
- `PROMOTING`: Promotion from logical standby to full PGD node is in progress.
- `ACTIVE`: The node is a full PGD node and is currently `ACTIVE`. This is the
most common node status.
- `PART_START`: Node was `ACTIVE` or `STANDBY` and `bdr.part_node` was just called
to remove the node from the EDB Postgres Distributed cluster.
- `PARTING`: Node disconnects from other nodes and plays no further part in
consensus or replication.
- `PART_CATCHUP`: Nonparting nodes synchronize any missing data from the
recently parted node.
- `PARTED`: Node parting operation is now complete on all nodes.
| State | Description |
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `NONE` | Node state is unset when the worker starts, expected to be set quickly to the current known state. |
| `CREATED` | `bdr.create_node()` was executed, but the node isn't a member of any EDB Postgres Distributed cluster yet. |
| `JOIN_START` | `bdr.join_node_group()` begins to join the local node to an existing EDB Postgres Distributed cluster. |
| `JOINING` | The node join has started and is currently at the initial sync phase, creating the schema and data on the node. |
| `CATCHUP` | Initial sync phase is completed. Now the join is at the last step of retrieving and applying transactions that were performed on the upstream peer node since the join started. |
| `STANDBY` | Node join finished but hasn't yet started to broadcast changes. All joins spend some time in this state, but if defined as a logical standby, the node continues in this state. |
| `PROMOTE` | Node was a logical standby and `bdr.promote_node` was just called to move the node state to `ACTIVE`. These two `PROMOTE` states have to be coherent to the fact that only one node can be with a state higher than `STANDBY` but lower than `ACTIVE`. |
| `PROMOTING` | Promotion from logical standby to full PGD node is in progress. |
| `ACTIVE` | The node is a full PGD node and is currently `ACTIVE`. This is the most common node status. |
| `PART_START` | Node was `ACTIVE` or `STANDBY` and `bdr.part_node` was just called to remove the node from the EDB Postgres Distributed cluster. |
| `PARTING` | Node disconnects from other nodes and plays no further part in consensus or replication. |
| `PART_CATCHUP` | Nonparting nodes synchronize any missing data from the recently parted node. |
| `PARTED` | Node parting operation is now complete on all nodes. |

Only one node at a time can be in either of the states PROMOTE or PROMOTING.

## Node-management commands
Expand Down Expand Up @@ -122,3 +111,60 @@ strongly recommend that you truncate the tables rather than drop them, because:

It's simpler and safer to truncate your nonreplicated tables, leaving them
present but empty.

### `bdr_config`

This command-line utility allows the user to examine the configuration of a PGD installation.
It is analogous to the `pg_config` utility that comes with PostgreSQL. It can be used to assist
in trouble-shooting and support.

#### Synopsis

```shell
bdr_config [OPTION] ...
```

#### Options

| Option           | Description |
| --- | --- |
| `--all` | Show all the keys and values in the configuration. |
| `--version` | Show only the BDR version related keys and values. This include the full version of the BDR extension, the Postgres version and flavor it is running against and the BDRPG and BDR plugin API versions. |
| `--debug` | Show only the BDR debug keys and values, including build information and feature enablement. |

#### Example

```shell
$ /usr/lib/edb-as/16/bin/bdr_config --all
__OUTPUT__
BDR_VERSION_COMPLETE=5.6.0
BDR_VERSION_NUM=50600
PG_VERSION=16.4.1 (Debian 16.4.1~~snapshot11329862135.2980.1.88fbec6-1.bookworm)
PG_VERSION_NUM=160004
PG_FLAVOR=EPAS
BDRPG_API_VERSION_NUM=202309131
BDR_PLUGIN_API_VERSION=7011
USE_ASSERT_CHECKING=false
USE_VALGRIND=false
EXT_ENABLE_DTRACE=false
HAVE_LAG_CONTROL=true
HAVE_ASSESS_UPDATE_RI_HOOK=false
HAVE_BDRPG_PROBES=false
HAVE_CAMO=true
HAVE_DEADLOCK_DETECTOR_HOOK=true
HAVE_HEAP_UPDATE_HOOK=true
HAVE_LAG_TRACKER=true
HAVE_LCR=true
HAVE_LOG_TOAST_COLUMNS=false
HAVE_MISC_HOOKS=true
HAVE_MISSING_PARTITION_CONFLICT=true
HAVE_MULTI_PITR=false
HAVE_SELECTIVE_BASEBACKUP=false
HAVE_SNAPSHOT_TIMESTAMP=false
HAVE_STREAMING_XACTS=true
HAVE_SYNC_COMMIT_HOOK=true
HAVE_TWOPHASE_DATA_HOOKS=true
HAVE_XLOG_FIND_NEXT_RECORD=true
HAVE_DETACH_CONCURRENTLY=true
HAVE_ANALYTICS=true
```

0 comments on commit 519155b

Please sign in to comment.