8000 Expose global snapshot funcs for (user-defined) 2PC on coordinator. · postgrespro/postgres_cluster@305e4bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 305e4bd

Browse files
committed
Expose global snapshot funcs for (user-defined) 2PC on coordinator.
1 parent 1896708 commit 305e4bd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/backend/access/transam/twophase.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
25482548
* This function is a counterpart of GlobalSnapshotPrepareCurrent() for
25492549
* twophase transactions.
25502550
*/
2551-
static GlobalCSN
2551+
GlobalCSN
25522552
GlobalSnapshotPrepareTwophase(const char *gid)
25532553
{
25542554
GlobalTransaction gxact;
@@ -2619,7 +2619,7 @@ pg_global_snapshot_prepare(PG_FUNCTION_ARGS)
26192619
* This function is a counterpart of GlobalSnapshotAssignCsnCurrent() for
26202620
* twophase transactions.
26212621
*/
2622-
static void
2622+
void
26232623
GlobalSnapshotAssignCsnTwoPhase(const char *gid, GlobalCSN global_csn)
26242624
{
26252625
GlobalTransaction gxact;

src/include/access/twophase.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ extern void PrepareRedoAdd(char *buf, XLogRecPtr start_lsn,
6161
XLogRecPtr end_lsn, RepOriginId origin_id);
6262
extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
6363
extern void restoreTwoPhaseData(void);
64+
65+
/* Global snapshots support for 2PC on coordinator */
66+
extern GlobalCSN GlobalSnapshotPrepareTwophase(const char *gid);
67+
extern void GlobalSnapshotAssignCsnTwoPhase(const char *gid, GlobalCSN global_csn);
68+
6469
#endif /* TWOPHASE_H */

0 commit comments

Comments
 (0)
0