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

Commitc235a6a

Browse files
committed
Don't try to set InvalidXid as page pruning hint
If a transaction updates/deletes a tuple just before aborting, and aconcurrent transaction tries to prune the page concurrently, the prunermay see HeapTupleSatisfiesVacuum return HEAPTUPLE_DELETE_IN_PROGRESS,but a later call to HeapTupleGetUpdateXid() return InvalidXid. Thiswould cause an assertion failure in development builds, but would beotherwise Mostly Harmless.Fix by checking whether the updater Xid is valid before trying to applyit as page prune point.Reported by Andres in 20131124000203.GA4403@alap2.anarazel.de
1 parente518fa7 commitc235a6a

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

‎src/backend/access/heap/pruneheap.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,22 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
479479
break;
480480

481481
caseHEAPTUPLE_DELETE_IN_PROGRESS:
482+
{
483+
TransactionIdxmax;
484+
485+
/*
486+
* This tuple may soon become DEAD. Update the hint field
487+
* so that the page is reconsidered for pruning in future.
488+
* If there was a MultiXactId updater, and it aborted after
489+
* HTSV checked, then we will get an invalid Xid here.
490+
* There is no need for future pruning of the page in that
491+
* case, so skip it.
492+
*/
493+
xmax=HeapTupleHeaderGetUpdateXid(htup);
494+
if (TransactionIdIsValid(xmax))
495+
heap_prune_record_prunable(prstate,xmax);
496+
}
482497

483-
/*
484-
* This tuple may soon become DEAD. Update the hint field so
485-
* that the page is reconsidered for pruning in future.
486-
*/
487-
heap_prune_record_prunable(prstate,
488-
HeapTupleHeaderGetUpdateXid(htup));
489498
break;
490499

491500
caseHEAPTUPLE_LIVE:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp