Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2021-01-24T06:17:58Z
Lists: pgsql-hackers
Attachments
- trigger_assert.sql (text/plain)
Hi, While working on pg14 compatibility for an extension relying on an apparently uncommon combination of FOR UPDATE and stored function calls, I hit some new Asserts introduced in 866e24d47db (Extend amcheck to check heap pages): + /* + * Do not allow tuples with invalid combinations of hint bits to be placed + * on a page. These combinations are detected as corruption by the + * contrib/amcheck logic, so if you disable one or both of these + * assertions, make corresponding changes there. + */ + Assert(!((tuple->t_data->t_infomask & HEAP_XMAX_LOCK_ONLY) && + (tuple->t_data->t_infomask2 & HEAP_KEYS_UPDATED))); I attach a simple self contained script to reproduce the problem, the last UPDATE triggering the Assert. I'm not really familiar with this part of the code, so it's not exactly clear to me if some logic is missing in compute_new_xmax_infomask() / heap_prepare_insert(), or if this should actually be an allowed combination of hint bit.
Commits
-
Reinstate HEAP_XMAX_LOCK_ONLY|HEAP_KEYS_UPDATED as allowed
- bf518fefacc7 10.17 landed
- 8deb6b38dc4c 14.0 landed
- 28f4b61083b2 13.3 landed
- 2796ae2ad253 12.7 landed
- 2583917075ae 11.12 landed
- 0ccebe779dc0 9.6.22 landed