Re: [BUG] failed assertion in EnsurePortalSnapshotExists() - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: [BUG] failed assertion in EnsurePortalSnapshotExists()
Date
Msg-id CAEudQAqYRH93L2qsEBb7jxpuBMYzUK+A1kG=R2E_m3=9vBuq-g@mail.gmail.com
Whole thread Raw
In response to Re: [BUG] failed assertion in EnsurePortalSnapshotExists()  ("Drouvot, Bertrand" <bdrouvot@amazon.com>)
Responses Re: [BUG] failed assertion in EnsurePortalSnapshotExists()  ("Drouvot, Bertrand" <bdrouvot@amazon.com>)
Re: [BUG] failed assertion in EnsurePortalSnapshotExists()  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Em qua., 29 de set. de 2021 às 08:12, Drouvot, Bertrand <bdrouvot@amazon.com> escreveu:

Hi,

On 9/29/21 12:59 PM, Ranier Vilela wrote:

Em qua., 29 de set. de 2021 às 06:55, Drouvot, Bertrand <bdrouvot@amazon.com> escreveu:
I'm also inclined to #1.
I have a stupid question, why duplicate PushActiveSnapshot?
Wouldn't one function be better?

PushActiveSnapshot(Snapshot snap, int as_level);

Sample calls:
PushActiveSnapshot(GetTransactionSnapshot(), GetCurrentTransactionNestLevel());
PushActiveSnapshot(queryDesc->snapshot, GetCurrentTransactionNestLevel());
PushActiveSnapshot(GetTransactionSnapshot(), portal->createSubid);

I would say because that could "break" existing extensions for example.

Adding a new function prevents "updating" existing extensions making use of PushActiveSnapshot().

Valid argument of course.
But the extensions should also fit the core code.
Duplicating functions is very bad for maintenance and bloats the code unnecessarily, IMHO.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Failed transaction statistics to measure the logical replication progress
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: [BUG] failed assertion in EnsurePortalSnapshotExists()