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

Commitd9e1ea4

Browse files
committed
Revert back-branch changes in behavior of age(xid).
Per discussion, it does not seem like a good idea to change the behavior ofage(xid) in a minor release, even though the old definition causes thefunction to fail on hot standby slaves. Therefore, revert commit5829387 and follow-on commits in the backbranches only.
1 parentfcd7fe5 commitd9e1ea4

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -386,30 +386,6 @@ GetCurrentTransactionIdIfAny(void)
386386
returnCurrentTransactionState->transactionId;
387387
}
388388

389-
/*
390-
*GetStableLatestTransactionId
391-
*
392-
* Get the XID once and then return same value for rest of transaction.
393-
* Acts as a useful reference point for maintenance tasks.
394-
*/
395-
TransactionId
396-
GetStableLatestTransactionId(void)
397-
{
398-
staticLocalTransactionIdlxid=InvalidLocalTransactionId;
399-
staticTransactionIdstablexid=InvalidTransactionId;
400-
401-
if (lxid!=MyProc->lxid)
402-
{
403-
lxid=MyProc->lxid;
404-
stablexid=GetTopTransactionIdIfAny();
405-
if (!TransactionIdIsValid(stablexid))
406-
stablexid=ReadNewTransactionId();
407-
}
408-
409-
Assert(TransactionIdIsValid(stablexid));
410-
411-
returnstablexid;
412-
}
413389

414390
/*
415391
* AssignTransactionId

‎src/backend/utils/adt/xid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ xideq(PG_FUNCTION_ARGS)
8787
}
8888

8989
/*
90-
*xid_age- compute age of an XID (relative tolatest stable xid)
90+
*xid_age- compute age of an XID (relative tocurrent xact)
9191
*/
9292
Datum
9393
xid_age(PG_FUNCTION_ARGS)
9494
{
9595
TransactionIdxid=PG_GETARG_TRANSACTIONID(0);
96-
TransactionIdnow=GetStableLatestTransactionId();
96+
TransactionIdnow=GetTopTransactionId();
9797

9898
/* Permanent XIDs are always infinitely old */
9999
if (!TransactionIdIsNormal(xid))

‎src/include/access/xact.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ extern TransactionId GetTopTransactionId(void);
177177
externTransactionIdGetTopTransactionIdIfAny(void);
178178
externTransactionIdGetCurrentTransactionId(void);
179179
externTransactionIdGetCurrentTransactionIdIfAny(void);
180-
externTransactionIdGetStableLatestTransactionId(void);
181180
externSubTransactionIdGetCurrentSubTransactionId(void);
182181
externCommandIdGetCurrentCommandId(boolused);
183182
externTimestampTzGetCurrentTransactionStartTimestamp(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp