Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, nasbyj(at)amazon(dot)com, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc
Date: 2021-06-23 13:01:55
Message-ID: 2078959.1624453315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Nancarrow <gregn4422(at)gmail(dot)com> writes:
> On Tue, Jun 22, 2021 at 10:56 PM Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
>> The comments in the function are clear:
>> If expression is mutable OR is a non-read-only function, so need a snapshot.

> I have to agree with you.
> Looks like the "&&" should really be an "||". The explanation in the
> code comment is pretty clear on this, as you say.

The code is correct as-is; the proposed change would result in taking
more snapshots than needed. Perhaps the comment needs revision, since
you both misread it. The comment is written in terms of "when can we
skip taking a snapshot", while the test in the code is written for
the inverse condition "when do we need a snapshot".

> I also verified that your patch seemed to fix the problem.

It accidentally masked it ... but only partially.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-06-23 13:08:35 Re: pgbench logging broken by time logic changes
Previous Message Simon Riggs 2021-06-23 12:50:07 Re: PG 14 release notes, first draft