Re: BUG #15727: PANIC: cannot abort transaction 295144144, it was already committed
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: r.zharkov@postgrespro.ru
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, pgsql-bugs@lists.postgresql.org
Date: 2019-04-03T12:20:27Z
Lists: pgsql-bugs
On 2019-Apr-03, r.zharkov@postgrespro.ru wrote:
> #0 0x00007f5e0dc7b428 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/unix/sysv/linux/raise.c:54
> #1 0x00007f5e0dc7d02a in __GI_abort () at abort.c:89
> #2 0x0000000000a9b7ce in ExceptionalCondition (
> conditionName=0xb3de08 "!((((tuple->t_data->t_infomask) & 0x0080) ||
> (((tuple->t_data->t_infomask) & (0x1000 | ((0x0040 | 0x0010) | 0x0040 |
> 0x0010))) == 0x0040)))",
> errorType=0xb39a69 "FailedAssertion", fileName=0xb39ae8 "heapam.c",
> lineNumber=4286) at assert.c:54
> #3 0x00000000004ea024 in heap_lock_tuple (relation=0x7f5e0f252d80,
> tuple=0x30f4dd0, cid=0, mode=LockTupleNoKeyExclusive,
> wait_policy=LockWaitBlock, follow_updates=false,
> buffer=0x7ffed968cbb4, tmfd=0x7ffed968cd80) at heapam.c:4286
Uhm ... this assertion failure is doesn't seem related to the other
problem you were reporting. Here, it's failing because it thinks the
tuple should be marked as only locked when the current transaction is
the only Xmax for the tuple.
/*
* As a check independent from those above, we can also avoid sleeping
* if the current transaction is the sole locker of the tuple. Note
* that the strength of the lock already held is irrelevant; this is
* not about recording the lock in Xmax (which will be done regardless
* of this optimization, below). Also, note that the cases where we
* hold a lock stronger than we are requesting are already handled
* above by not doing anything.
*
* Note we only deal with the non-multixact case here; MultiXactIdWait
* is well equipped to deal with this situation on its own.
*/
if (require_sleep && !(infomask & HEAP_XMAX_IS_MULTI) &&
TransactionIdIsCurrentTransactionId(xwait))
{
/* ... but if the xmax changed in the meantime, start over */
LockBuffer(*buffer, BUFFER_LOCK_EXCLUSIVE);
if (xmax_infomask_changed(tuple->t_data->t_infomask, infomask) ||
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(tuple->t_data),
xwait))
goto l3;
Assert(HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_data->t_infomask)); // <--- failed assertion
require_sleep = false;
}
I'm not quite sure what's up with that.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix GetNewTransactionId()'s interaction with xidVacLimit.
- f7feb020c3d8 12.0 landed
-
Fix example in comment.
- 16954e22e2a8 12.0 cited
-
Fix EvalPlanQualStart to handle partitioned result rels correctly.
- 1b5bbe4bcc91 10.8 landed
- b291488da513 11.3 landed
- a8cb8f124679 12.0 landed
-
Fix a number of issues around modifying a previously updated row.
- 41f5e04aec6c 12.0 landed
-
Use FullTransactionId for the transaction stack.
- ad308058cc86 12.0 cited
-
Add basic infrastructure for 64 bit transaction IDs.
- 2fc7af5e9660 12.0 cited
-
tableam: Add tuple_{insert, delete, update, lock} and use.
- 5db6df0c0117 12.0 cited
-
Throw error if expiring tuple is again updated or deleted.
- 6868ed7491b7 9.3.0 cited