Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1896708

Browse files
committed
POST_PREPARE xact event and expose gid during PRE_PREPARE.
1 parentc5c69c1 commit1896708

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,8 @@ PrepareTransaction(void)
24632463
s->state=TRANS_DEFAULT;
24642464

24652465
RESUME_INTERRUPTS();
2466+
2467+
CallXactCallbacks(XACT_EVENT_POST_PREPARE);
24662468
}
24672469

24682470

@@ -5848,3 +5850,10 @@ xact_redo(XLogReaderState *record)
58485850
else
58495851
elog(PANIC,"xact_redo: unknown op code %u",info);
58505852
}
5853+
5854+
/* Get gid for ongoing PREPARE */
5855+
constchar*
5856+
GetPrepareGid(void)
5857+
{
5858+
returnprepareGID;
5859+
}

‎src/include/access/xact.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ typedef enum
111111
XACT_EVENT_PREPARE,
112112
XACT_EVENT_PRE_COMMIT,
113113
XACT_EVENT_PARALLEL_PRE_COMMIT,
114-
XACT_EVENT_PRE_PREPARE
114+
XACT_EVENT_PRE_PREPARE,
115+
XACT_EVENT_POST_PREPARE
115116
}XactEvent;
116117

117118
typedefvoid (*XactCallback) (XactEventevent,void*arg);
@@ -399,6 +400,7 @@ extern void RegisterXactCallback(XactCallback callback, void *arg);
399400
externvoidUnregisterXactCallback(XactCallbackcallback,void*arg);
400401
externvoidRegisterSubXactCallback(SubXactCallbackcallback,void*arg);
401402
externvoidUnregisterSubXactCallback(SubXactCallbackcallback,void*arg);
403+
externconstchar*GetPrepareGid(void);
402404

403405
externintxactGetCommittedChildren(TransactionId**ptr);
404406

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp