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

Commit3dfaea4

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 parent56901be commit3dfaea4

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
@@ -392,30 +392,6 @@ GetCurrentTransactionIdIfAny(void)
392392
returnCurrentTransactionState->transactionId;
393393
}
394394

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

420396
/*
421397
* 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
@@ -198,7 +198,6 @@ extern TransactionId GetTopTransactionId(void);
198198
externTransactionIdGetTopTransactionIdIfAny(void);
199199
externTransactionIdGetCurrentTransactionId(void);
200200
externTransactionIdGetCurrentTransactionIdIfAny(void);
201-
externTransactionIdGetStableLatestTransactionId(void);
202201
externSubTransactionIdGetCurrentSubTransactionId(void);
203202
externCommandIdGetCurrentCommandId(boolused);
204203
externTimestampTzGetCurrentTransactionStartTimestamp(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp