From 5b0b4951253a9c159cee9a269169630daa9d04f6 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 4 Dec 2024 11:25:24 +0900 Subject: [PATCH] pgd: document node synchronisation catalogue objects BRD issue 5548 added a view and a helper function: - bdr.sync_status_name() - bdr.sync_node_requests_summary to provide a human-readable version of the "bdr.sync_node_requests" catalogue table. Document that as well while we're there. BDR-5805. --- .../pgd/5.6/reference/catalogs-internal.mdx | 39 +++++++++++++++++++ .../pgd/5.6/reference/functions-internal.mdx | 20 +++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/product_docs/docs/pgd/5.6/reference/catalogs-internal.mdx b/product_docs/docs/pgd/5.6/reference/catalogs-internal.mdx index 7a076ca38be..bbc1d326ca1 100644 --- a/product_docs/docs/pgd/5.6/reference/catalogs-internal.mdx +++ b/product_docs/docs/pgd/5.6/reference/catalogs-internal.mdx @@ -274,3 +274,42 @@ An internal state table storing the type of each non-local sequence. We recommen |---------|------|-----------------------------------------------------------------------------| | seqid | oid | Internal OID of the sequence | | seqkind | char | Internal sequence kind (`l`=local,`t`=timeshard,`s`=snowflakeid,`g`=galloc) | + + +### `bdr.sync_node_requests` + +An internal state table storing the state of node synchronization requests. The view +[`bdr.sync_node_requests_summary`](catalogs-internal#bdrsync_node_requests_summary) +provides a human-readable representation of this table. + +### `bdr.sync_node_requests` columns + +| Name | Type | Description | +| ----------------- | ----------- | ------------------------------------------------- | +| sn_origin_node_id | oid | Unavailable node with changes to be synchronized | +| sn_target_node_id | oid | Node with the origin node's changes | +| sn_source_node_id | oid | Target node for the sync request | +| sn_sync_start_lsn | pg_lsn | Start LSN of the sync request | +| sn_sync_start_ts | timestamptz | Start timestamp of the sync request | +| sn_sync_end_lsn | pg_lsn | End LSN of the sync request | +| sn_sync_end_ts | timestamptz | End timestamp of the sync request | +| sn_sync_status | text | Status of the sync request | + +### `bdr.sync_node_requests_summary` + +A view providing a human-readable version of the underlying [`bdr.sync_node_requests`](catalogs-internal#bdrsync_node_requests) +table. + +#### `bdr.sync_node_requests_summary` columns + +| Name | Type | Description | +| -------------- | ----------- | ------------------------------------------------- | +| origin | text | Unavailable node with changes to be synchronized | +| source | text | Node with the origin node's changes | +| target | text | Target node for the sync request | +| sync_start_lsn | pg_lsn | Start LSN of the sync request | +| sync_start_ts | timestamptz | Start timestamp of the sync request | +| sync_end_lsn | pg_lsn | End LSN of the sync request | +| sync_end_ts | timestamptz | End timestamp of the sync request | +| sync_status | text | Status of the sync request | + diff --git a/product_docs/docs/pgd/5.6/reference/functions-internal.mdx b/product_docs/docs/pgd/5.6/reference/functions-internal.mdx index b275c29e62c..57ae5a89f0d 100644 --- a/product_docs/docs/pgd/5.6/reference/functions-internal.mdx +++ b/product_docs/docs/pgd/5.6/reference/functions-internal.mdx @@ -421,6 +421,24 @@ bdr.show_workers( Function used in the `bdr.writers` view. +### `bdr.sync_status_name` + +Converts sync state code into a textual representation. +Used mainly to implement the [`bdr.sync_node_requests_summary`](catalogs-internal#bdrsync_node_requests_summary) +view. + +#### Synopsis + +```sql +bdr.sync_status_name(sync_state oid) +``` + +#### Parameters + +| Parameter | Description | +|--------------|-------------------------------| +| `sync_state` | Oid code of the sync state. | + ## Task manager functions ### `bdr.taskmgr_set_leader` @@ -528,4 +546,4 @@ Internal function used when generating view `bdr.group_versions_details`. Do not ### `bdr.node_group_member_info` -Internal function used when generating view `bdr.group_raft_details`. Do not use directly. Use the [`bdr.group_raft_details`](/pgd/latest/reference/catalogs-visible#bdrgroup_raft_details) view instead. \ No newline at end of file +Internal function used when generating view `bdr.group_raft_details`. Do not use directly. Use the [`bdr.group_raft_details`](/pgd/latest/reference/catalogs-visible#bdrgroup_raft_details) view instead.