Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-10-18T10:55:54Z
Lists: pgsql-hackers
On Mon, Oct 17, 2022 at 7:05 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > On Thu, Oct 13, 2022 at 4:08 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > --- a/src/backend/replication/logical/decode.c > > +++ b/src/backend/replication/logical/decode.c > > @@ -113,6 +113,15 @@ > > LogicalDecodingProcessRecord(LogicalDecodingContext *ctx, > > XLogReaderState *recor > > buf.origptr); > > } > > > > +#ifdef USE_ASSERT_CHECKING > > + /* > > + * Check the order of transaction LSNs when we reached the start decoding > > + * LSN. See the comments in AssertTXNLsnOrder() for details. > > + */ > > + if (SnapBuildGetStartDecodingAt(ctx->snapshot_builder) == buf.origptr) > > + AssertTXNLsnOrder(ctx->reorder); > > +#endif > > + > > rmgr = GetRmgr(XLogRecGetRmid(record)); > > > > > > > I am not able to think how/when this check will be useful. Because we > > skipped assert checking only for records that are prior to > > start_decoding_at point, I think for those records ordering should > > have been checked before the restart. start_decoding_at point will be > > either (a) confirmed_flush location, or (b) lsn sent by client, and > > any record prior to that must have been processed before restart. > > Good point. I was considering the case where the client sets far ahead > LSN but it's not worth considering this case in this context. I've > updated the patch accoringly. > One minor comment: Can we slightly change the comment: ". The ordering of the records prior to the LSN, we should have been checked before the restart." to ". The ordering of the records prior to the start_decoding_at LSN should have been checked before the restart."? -- With Regards, Amit Kapila.
Commits
-
Fix executing invalidation messages generated by subtransactions during decoding.
- 343afa967106 15.1 landed
- 4fbe6096b954 14.6 landed
- 38dbaaf27387 13.9 landed
- 02600886c8a8 12.13 landed
- 216af69aec0d 11.18 landed
-
Fix assertion failures while processing NEW_CID record in logical decoding.
- 64ff0fe4e8c4 15.1 landed
- a592ed923e67 14.6 landed
- 25f7be1ca236 13.9 landed
- 1bf4d92060ee 12.13 landed
- 5f7076cb609e 11.18 landed
- 10ed7b9e4b19 10.23 landed
- 16b1fe0037dc 16.0 landed
-
Immediately WAL-log subtransaction and top-level XID association.
- 0bead9af484c 14.0 cited
-
Stop demanding that top xact must be seen before subxact in decoding.
- e3ff789acfb2 13.0 cited