Re: BUG #15727: PANIC: cannot abort transaction 295144144, it wasalready committed - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #15727: PANIC: cannot abort transaction 295144144, it wasalready committed
Date
Msg-id 20190406172708.4j6esqqze6ksayyw@alap3.anarazel.de
Whole thread Raw
In response to Re: BUG #15727: PANIC: cannot abort transaction 295144144, it wasalready committed  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
Hi,

On 2019-04-06 10:10:25 -0700, Andres Freund wrote:
> diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c
> index add0d65f816..4bca240f367 100644
> --- a/src/backend/access/heap/heapam_handler.c
> +++ b/src/backend/access/heap/heapam_handler.c
> @@ -464,7 +464,7 @@ tuple_lock_retry:
>                          HeapTupleHeaderGetCmin(tuple->t_data) >= cid)
>                      {
>                          ReleaseBuffer(buffer);
> -                        return TM_Invisible;
> +                        return TM_SelfModified;
>                      }

This needs to set
tmfd->cmax = HeapTupleHeaderGetCmax(tuple->t_data);
so we don't throw
                if (tmfd.cmax != estate->es_output_cid)
                    ereport(ERROR,
                            (errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
                             errmsg("tuple to be updated was already modified by an operation triggered by the current
command"),
                             errhint("Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes
toother rows.")));
 

in the testcase at hand.

Greetings,

Andres Freund



pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #15727: PANIC: cannot abort transaction 295144144, it wasalready committed
Next
From: Andres Freund
Date:
Subject: Re: BUG #15727: PANIC: cannot abort transaction 295144144, it wasalready committed