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

Commit74ebba8

Browse files
committed
Redefine HEAP_XMAX_IS_LOCKED_ONLY
Tuples marked SELECT FOR UPDATE in a cluster that's later processed bypg_upgrade would have a different infomask bit pattern than thoseproduced by 9.3dev; that bit pattern was being seen as "dead" by HEAD(because they would fail the "is this tuple locked" test, and so thevisibility rules would thing they're updated, even though there's noHEAP_UPDATED version of them). In other words, some rows could silentlydisappear after pg_upgrade.With this new definition, those tuples become visible again.This is breakage resulting from my commit0ac5ad5.
1 parent34da700 commit74ebba8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎src/include/access/htup_details.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,19 @@ struct HeapTupleHeaderData
189189
#defineHEAP_XACT_MASK0xFFF0/* visibility-related bits */
190190

191191
/*
192-
* A tuple is only locked (i.e. not updated by its Xmax) if it the
193-
* HEAP_XMAX_LOCK_ONLY bit is set.
192+
* A tuple is only locked (i.e. not updated by its Xmax) if the
193+
* HEAP_XMAX_LOCK_ONLY bit is set; or, for pg_upgrade's sake, if the Xmax is
194+
* not a multi and the EXCL_LOCK bit is set.
194195
*
195196
* See also HeapTupleHeaderIsOnlyLocked, which also checks for a possible
196197
* aborted updater transaction.
198+
*
199+
* Beware of multiple evaluations of the argument.
197200
*/
198201
#defineHEAP_XMAX_IS_LOCKED_ONLY(infomask) \
199-
((infomask) & HEAP_XMAX_LOCK_ONLY)
202+
(((infomask) & HEAP_XMAX_LOCK_ONLY) || \
203+
(((infomask) & (HEAP_XMAX_IS_MULTI | HEAP_LOCK_MASK)) == HEAP_XMAX_EXCL_LOCK))
204+
200205
/*
201206
* Use these to test whether a particular lock is applied to a tuple
202207
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp