Skip to content

Pgd 5.8 #6659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

Pgd 5.8 #6659

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
375 changes: 0 additions & 375 deletions product_docs/docs/pgd/5.7/reference/index.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ navigation:
- reference
pdf: true
directoryDefaults:
version: "5.7.0"
version: "5.8.0"
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,4 @@ table.
| 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 |
| sync_status | text | Status of the sync request |
376 changes: 376 additions & 0 deletions product_docs/docs/pgd/5.8/reference/index.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ The reference section is a definitive listing of all functions, views, and comma
* [`bdr.extract_nodeid_from_timeshard`](sequences#bdrextract_nodeid_from_timeshard)
* [`bdr.extract_localseqid_from_timeshard`](sequences#bdrextract_localseqid_from_timeshard)
* [`bdr.timestamp_to_timeshard`](sequences#bdrtimestamp_to_timeshard)
* [`bdr.galloc_chunk_info`](sequences#bdrgalloc_chunk_info)
### [KSUUID v2 functions](sequences#ksuuid-v2-functions)
* [`bdr.gen_ksuuid_v2`](sequences#bdrgen_ksuuid_v2)
* [`bdr.ksuuid_v2_cmp`](sequences#bdrksuuid_v2_cmp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,30 @@ bdr.timestamp_to_timeshard(ts timestamptz)

This function executes only on the local node.

### `bdr.galloc_chunk_info`

This function retrieves the ranges allocated to a galloc sequence on the local
node.

An empty result set will be returned if the sequence has not yet been accessed
on the local node.

An ERROR will be raised if the provided sequence name is not a galloc sequence.

#### Synopsis

```sql
bdr.galloc_chunk_info(seqname regclass)
```

#### Parameters

- `seqname` - the name of the galloc sequence to query

#### Notes

This function executes only on the local node.

## KSUUID v2 functions

Functions for working with `KSUUID` v2 data, K-Sortable UUID data. See also [KSUUID in the sequences documentation](../sequences/#ksuuids).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ navTitle: Release notes
description: Release notes for EDB Postgres Distributed 5 and later
indexCards: none
navigation:
- pgd_5.8.0_rel_notes
- pgd_5.7.0_rel_notes
- pgd_5.6.1_rel_notes
- pgd_5.6.0_rel_notes
Expand All @@ -16,7 +17,7 @@ navigation:
- pgd_5.1.0_rel_notes
- pgd_5.0.1_rel_notes
- pgd_5.0.0_rel_notes
originalFilePath: product_docs/docs/pgd/5.7/rel_notes/src/meta.yml
originalFilePath: product_docs/docs/pgd/5.8/rel_notes/src/meta.yml
editTarget: originalFilePath
---

Expand All @@ -26,6 +27,7 @@ The EDB Postgres Distributed documentation describes the latest version of EDB P

| Release Date | EDB Postgres Distributed | BDR extension | PGD CLI | PGD Proxy |
|---|---|---|---|---|
| 22 May 2025 | [5.8.0](./pgd_5.8.0_rel_notes) | 5.8.0 | 5.8.0 | 5.8.0 |
| 25 Feb 2025 | [5.7.0](./pgd_5.7.0_rel_notes) | 5.7.0 | 5.7.0 | 5.7.0 |
| 25 Nov 2024 | [5.6.1](./pgd_5.6.1_rel_notes) | 5.6.1 | 5.6.1 | 5.6.1 |
| 15 Oct 2024 | [5.6.0](./pgd_5.6.0_rel_notes) | 5.6.0 | 5.6.0 | 5.6.0 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: EDB Postgres Distributed 5.6.0 release notes
navTitle: Version 5.6.0
originalFilePath: product_docs/docs/pgd/5.7/rel_notes/src/relnote_5.6.0.yml
originalFilePath: product_docs/docs/pgd/5.8/rel_notes/src/relnote_5.6.0.yml
editTarget: originalFilePath
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: EDB Postgres Distributed 5.6.1 release notes
navTitle: Version 5.6.1
originalFilePath: product_docs/docs/pgd/5.7/rel_notes/src/relnote_5.6.1.yml
originalFilePath: product_docs/docs/pgd/5.8/rel_notes/src/relnote_5.6.1.yml
editTarget: originalFilePath
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: EDB Postgres Distributed 5.7.0 release notes
navTitle: Version 5.7.0
originalFilePath: product_docs/docs/pgd/5.7/rel_notes/src/relnote_5.7.0.yml
originalFilePath: product_docs/docs/pgd/5.8/rel_notes/src/relnote_5.7.0.yml
editTarget: originalFilePath
---

Expand Down
22 changes: 22 additions & 0 deletions product_docs/docs/pgd/5.8/rel_notes/pgd_5.8.0_rel_notes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: EDB Postgres Distributed 5.8.0 release notes
navTitle: Version 5.8.0
originalFilePath: product_docs/docs/pgd/5.8/rel_notes/src/relnote_5.8.0.yml
editTarget: originalFilePath
---

Released: 22 May 2025

EDB Postgres Distributed 5.8.0 includes a number of enhancements and bug fixes.

## Highlights

* Simpler sequence management with `bdr.galloc_chunk_info()`

## Enhancements

<table class="table w-100"><thead><tr><th>Component</th><th>Version</th><th>Description</th><th width="10%">Addresses</th></tr></thead><tbody>
<tr><td>BDR</td><td>5.8.0</td><td>Added `bdr.galloc_chunk_info()` function to simplify sequences</td><td></td></tr>
</tbody></table>


29 changes: 29 additions & 0 deletions product_docs/docs/pgd/5.8/rel_notes/src/relnote_5.8.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/EnterpriseDB/docs/refs/heads/develop/tools/automation/generators/relgen/relnote-schema.json
product: EDB Postgres Distributed
version: 5.8.0
date: 22 May 2025
components:
"BDR": 5.8.0
"PGD CLI": 5.8.0
"PGD Proxy": 5.8.0
"Utilities": 5.8.0
intro: |
EDB Postgres Distributed 5.8.0 includes a number of enhancements and bug fixes.
highlights: |
* Simpler sequence management with `bdr.galloc_chunk_info()`

relnotes:
- relnote: Added `bdr.galloc_chunk_info()` function to simplify sequences
description: |
The `bdr.galloc_chunk_info()` function provides information about the chunk
allocation for a given sequence. This function returns the chunk ID, the
sequence ID, and the chunk size. This function is useful for debugging and
understanding how sequences are allocated in BDR.
component: BDR
impact: Medium
jira: BDR-6144
addresses: ""
type: Enhancement



Original file line number Diff line number Diff line change
Expand Up @@ -332,48 +332,30 @@ SELECT * FROM bdr.sequence_alloc
(1 row)
```

To see the ranges currently assigned to a given sequence on each node, use
these queries:
To see the ranges currently assigned to a given sequence on each node, execute the function
[`bdr.galloc_chunk_info`](reference/sequences/#bdrgalloc_chunk_info).

* Node `Node1` is using range from `333` to `2000333`.
- Node `Node1` is using range from `334` to `2000333`.

```sql
SELECT last_value AS range_start, log_cnt AS range_end
FROM categories_category_seq WHERE ctid = '(0,2)'; -- first range
range_start | range_end
SELECT * FROM bdr.galloc_chunk_info('categories_category_seq');
chunk_start | chunk_end
-------------+-----------
334 | 1000333
(1 row)

SELECT last_value AS range_start, log_cnt AS range_end
FROM categories_category_seq WHERE ctid = '(0,3)'; -- second range
range_start | range_end
-------------+-----------
1000334 | 2000333
(1 row)
(2 rows)
```

* Node `Node2` is using range from `2000334` to `4000333`.
- Node `Node2` is using range from `2000334` to `4000333`.

```sql
SELECT last_value AS range_start, log_cnt AS range_end
FROM categories_category_seq WHERE ctid = '(0,2)'; -- first range
range_start | range_end
SELECT * FROM bdr.galloc_chunk_info('categories_category_seq');
chunk_start | chunk_end
-------------+-----------
2000334 | 3000333
(1 row)

SELECT last_value AS range_start, log_cnt AS range_end
FROM categories_category_seq WHERE ctid = '(0,3)'; -- second range
range_start | range_end
-------------+-----------
3000334 | 4000333
```

!!! NOTE
You can't combine it to a single query (like `WHERE ctid IN ('(0,2)', '(0,3)')`),
as that still shows only the first range.

When a node finishes a chunk, it asks a consensus for a new one and gets the
first available. In the example, it's from 4000334 to 5000333. This is
the new reserved chunk and starts to consume the old reserved chunk.
Expand Down