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

Commit4ed0640

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 parentfbface6 commit4ed0640

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
@@ -466,13 +466,22 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
466466
break;
467467

468468
caseHEAPTUPLE_DELETE_IN_PROGRESS:
469+
{
470+
TransactionIdxmax;
471+
472+
/*
473+
* This tuple may soon become DEAD. Update the hint field
474+
* so that the page is reconsidered for pruning in future.
475+
* If there was a MultiXactId updater, and it aborted after
476+
* HTSV checked, then we will get an invalid Xid here.
477+
* There is no need for future pruning of the page in that
478+
* case, so skip it.
479+
*/
480+
xmax=HeapTupleHeaderGetUpdateXid(htup);
481+
if (TransactionIdIsValid(xmax))
482+
heap_prune_record_prunable(prstate,xmax);
483+
}
469484

470-
/*
471-
* This tuple may soon become DEAD. Update the hint field so
472-
* that the page is reconsidered for pruning in future.
473-
*/
474-
heap_prune_record_prunable(prstate,
475-
HeapTupleHeaderGetUpdateXid(htup));
476485
break;
477486

478487
caseHEAPTUPLE_LIVE:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp