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-03-02T06:26:33Z
Lists: pgsql-bugs, pgsql-hackers
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
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