Re: ERROR: subtransaction logged without previous top-level txn record - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: ERROR: subtransaction logged without previous top-level txn record
Date
Msg-id CAA4eK1LuOGujY2v0u5bAp1VEKfWebHXBSEP0L-DO88p0MXFioQ@mail.gmail.com
Whole thread Raw
In response to Re: ERROR: subtransaction logged without previous top-level txn record  (Arseny Sher <a.sher@postgrespro.ru>)
Responses Re: ERROR: subtransaction logged without previous top-level txn record
List pgsql-bugs
On Sun, Feb 9, 2020 at 9:37 PM Arseny Sher <a.sher@postgrespro.ru> wrote:
>
>
> Somehow I hadn't realized this earlier, so my comments/commit messages
> in patches above were not accurate here; I've edited them. Also in the
> first patch serialized snapshots are not no longer used for new slot
> creation at all, as Andres suggested above.
>

+ /*
+ * Don't use serialized snapshot if we are not sure where all
+ * currently running xacts will finish (new slot creation).
+ * (Actually, if we came here through xl_running_xacts, we could perform
+ * SNAPBUILD_FULL_SNAPSHOT -> SNAPBUILD_CONSISTENT transition properly,
+ * but added lines of code would hardly worth the benefit.)
+ */
+ if (builder->start_decoding_at == InvalidXLogRecPtr)
+ return false;

Instead of using start_decoding_at to decide whether to restore
snapshot or not, won't it be better to have new variable in SnapBuild
(say can_use_serialized_snap or something like that) and for this
purpose?

I think the patch is trying to use a variable that is not meant for
the purpose we are using for it, so not sure if it is the right
direction for the fix.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #16276: Server crash on an invalid attempt to attach apartition to an index
Next
From: Arseny Sher
Date:
Subject: Re: ERROR: subtransaction logged without previous top-level txn record