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

Commita2f9572

Browse files
committed
Move multixid allocation out of critical section.
It can fail if you run out of memory.This call was added in 9.3, so backpatch to 9.3 only.
1 parent1891a4b commita2f9572

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,21 @@ heap_delete(Relation relation, ItemPointer tid,
27172717
/* replace cid with a combo cid if necessary */
27182718
HeapTupleHeaderAdjustCmax(tp.t_data,&cid,&iscombo);
27192719

2720+
/*
2721+
* If this is the first possibly-multixact-able operation in the current
2722+
* transaction, set my per-backend OldestMemberMXactId setting. We can be
2723+
* certain that the transaction will never become a member of any older
2724+
* MultiXactIds than that.(We have to do this even if we end up just
2725+
* using our own TransactionId below, since some other backend could
2726+
* incorporate our XID into a MultiXact immediately afterwards.)
2727+
*/
2728+
MultiXactIdSetOldestMember();
2729+
2730+
compute_new_xmax_infomask(HeapTupleHeaderGetRawXmax(tp.t_data),
2731+
tp.t_data->t_infomask,tp.t_data->t_infomask2,
2732+
xid,LockTupleExclusive, true,
2733+
&new_xmax,&new_infomask,&new_infomask2);
2734+
27202735
START_CRIT_SECTION();
27212736

27222737
/*
@@ -2736,21 +2751,6 @@ heap_delete(Relation relation, ItemPointer tid,
27362751
vmbuffer);
27372752
}
27382753

2739-
/*
2740-
* If this is the first possibly-multixact-able operation in the current
2741-
* transaction, set my per-backend OldestMemberMXactId setting. We can be
2742-
* certain that the transaction will never become a member of any older
2743-
* MultiXactIds than that.(We have to do this even if we end up just
2744-
* using our own TransactionId below, since some other backend could
2745-
* incorporate our XID into a MultiXact immediately afterwards.)
2746-
*/
2747-
MultiXactIdSetOldestMember();
2748-
2749-
compute_new_xmax_infomask(HeapTupleHeaderGetRawXmax(tp.t_data),
2750-
tp.t_data->t_infomask,tp.t_data->t_infomask2,
2751-
xid,LockTupleExclusive, true,
2752-
&new_xmax,&new_infomask,&new_infomask2);
2753-
27542754
/* store transaction information of xact deleting the tuple */
27552755
tp.t_data->t_infomask &= ~(HEAP_XMAX_BITS |HEAP_MOVED);
27562756
tp.t_data->t_infomask2 &= ~HEAP_KEYS_UPDATED;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp