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

Commit0e2c05a

Browse files
committed
Prevent tuples to be marked as dead in subtransactions on standbys
Dead tuples are ignored and are not marked as dead during recovery, asit can lead to MVCC issues on a standby because its xmin may not matchwith the primary. This information is tracked by a field called"xactStartedInRecovery" in the transaction state data, switched on whenstarting a transaction in recovery.Unfortunately, this information was not correctly tracked when startinga subtransaction, because the transaction state used for thesubtransaction did not update "xactStartedInRecovery" based on the stateof its parent. This would cause index scans done in subtransactions toreturn inconsistent data, depending on how the xmin of the primaryand/or the standby evolved.This is broken since the introduction of hot standby inefc16ea, sobackpatch all the way down.Author: Fei ChanghongReviewed-by: Kyotaro HoriguchiDiscussion:https://postgr.es/m/tencent_C4D907A5093C071A029712E73B43C6512706@qq.comBackpatch-through: 12
1 parent810c960 commit0e2c05a

File tree

1 file changed

+1
-0
lines changed
  • src/backend/access/transam

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5285,6 +5285,7 @@ PushTransaction(void)
52855285
s->blockState=TBLOCK_SUBBEGIN;
52865286
GetUserIdAndSecContext(&s->prevUser,&s->prevSecContext);
52875287
s->prevXactReadOnly=XactReadOnly;
5288+
s->startedInRecovery=p->startedInRecovery;
52885289
s->parallelModeLevel=0;
52895290
s->topXidLogged= false;
52905291

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp