Skip to content
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

[6X] Add distributed snapshot support to pg_export_snapshot #13470

Merged
merged 3 commits into from May 24, 2022

Conversation

bmdoil
Copy link
Contributor

@bmdoil bmdoil commented May 11, 2022

Backport from #13201

Add distributed snapshot support to pg_export_snapshot

pg_export_snapshot now exports distributed snapshot metadata, enabling cluster-wide data visibility consistency via SET TRANSACTION SNAPSHOT

Calling select pg_export_snapshot() from the QD will write the
following fields to the snapshot file in pg_snapshots in the
coordinator data directory.

dsxminall
dsid
dsxmin
dsxmax
dscnt
dsxip

When a snapshot is imported via SET TRANSACTION SNAPSHOT from the QD, subsequent
queries will have the distributed snapshot metadata dispatched to the QEs.

Reference: https://groups.google.com/a/greenplum.org/g/gpdb-dev/c/C6cY8yIbcps

Copy link
Contributor

@soumyadeep2007 soumyadeep2007 left a comment

Choose a reason for hiding this comment

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

LGTM! It would be nice if you can follow the following backport format for the commit messages:

Backport commit messages should be of the following form:

Clean cherry-picks where there is no conflict resolution (tip: run with -x)

<original commit message title>

<original commit message body>

(cherry-picked from commit <SHA of **merged commit** in 7x>)

OR

Unclean cherry-picks where conflict resolution was necessary:

<original commit message title>

Backported from commit <SHA of **merged commit** in 7x>

Conflict resolution:
<conflict resolution details>

Original commit message follows:

<original commit message body>

(Backported from commit 78ef1c0)

Conflict resolution:
- 6X uses maxCount instead of GetMaxSnapshotXidCount to
  allocate XID array. ref: 37d683e
This commit ensures that we use setDistributedTransactionContext() in
sinval.c, the only place where we weren't.

Also, this commit ensures that we log the act of setting the context,
while respecting the debug_print_full_dtm GUC.

(cherry-picked from commit 2fafef9,
minor changes to formatting)
This commit adds distributed snapshot metadata when exporting and
importing snapshots.

Calling `select pg_export_snapshot()` from the QD will write the
following fields to the snapshot file in `pg_snapshots` in the
coordinator data directory.

```
dsxminall
dsid
dsxmin
dsxmax
dscnt
dsxip
```

When a snapshot is imported via SET TRANSACTION SNAPSHOT from the QD, subsequent
queries will have the distributed snapshot metadata dispatched to the QEs.
This enables cluster-wide data visibility consistency.

(cherry picked from commit eeb37b9,
parseDistributedXidFromText function not backported)
@bmdoil bmdoil merged commit 1bbccb7 into greenplum-db:6X_STABLE May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants