Re: ERROR: subtransaction logged without previous top-level txn record
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Arseny Sher <a.sher@postgrespro.ru>
Cc: Andres Freund <andres@anarazel.de>, "Hsu, John" <hsuchen@amazon.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2020-02-03T12:54:22Z
Lists: pgsql-bugs, pgsql-hackers
On Mon, Feb 3, 2020 at 2:50 PM Arseny Sher <a.sher@postgrespro.ru> wrote:
>
>
> Amit Kapila <amit.kapila16@gmail.com> writes:
>
> >> I don't see a bug here. At least in reproduced scenario I see false
> >> alert, as explained above: transaction with skipped xl_xact_assignment
> >> won't be streamed as it finishes before confirmed_flush_lsn.
> >>
> >
> > Does this guarantee come from the fact that we need to wait for such a
> > transaction before reaching a consistent snapshot state? If not, can
> > you explain a bit more what makes you say so?
>
> Right, see FULL_SNAPSHOT -> SNAPBUILD_CONSISTENT transition -- it exists
> exactly for this purpose: once we have good snapshot, we need to wait
> for all running xacts to finish to see all xacts we are promising to
> stream in full.
>
So, doesn't this mean that it started occurring after the fix done in
commit 96b5033e11 [1]? Because before that fix we wouldn't have
allowed processing XLOG_XACT_ASSIGNMENT records unless we are in
SNAPBUILD_FULL_SNAPSHOT state. I am not telling the fix in that
commit is wrong, but just trying to understand the situation here.
>
> Well, almost. This is true as long initial snapshot construction process
> goes the long way of building the snapshot by itself. If it happens to
> pick up from disk ready snapshot pickled there by another decoding
> session, it fast path'es to SNAPBUILD_CONSISTENT, which is technically a
> bug as described in
> https://www.postgresql.org/message-id/87ftjifoql.fsf%40ars-thinkpad
>
Can't we deal with this separately? If so, I think let's not mix the
discussions for both as the root cause of both seems different.
[1] -
commit bac2fae05c7737530a6fe8276cd27d210d25c6ac
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2019-09-13 16:36:28 -0300
logical decoding: process ASSIGNMENT during snapshot build
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
Commits
-
Stop demanding that top xact must be seen before subxact in decoding.
- 05555f7aaa08 9.5.22 landed
- 59c1a03f0736 9.6.18 landed
- b448aa44170b 10.13 landed
- bff456d7a0b3 11.8 landed
- 59112f235549 12.3 landed
- e3ff789acfb2 13.0 landed
-
logical decoding: process ASSIGNMENT during snapshot build
- bac2fae05c77 13.0 cited
- 96b5033e1171 12.0 cited
-
Fix operator naming in pg_trgm GUC option descriptions
- 959792087a10 9.6.14 cited