Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Дата
Msg-id CAA4eK1KS796rQEHTUY_Zed=pvAHmC9E7yD9MVFgfMS9dTZoF9g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-hackers
On Thu, Jul 28, 2022 at 12:56 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Thu, Jul 28, 2022 at 4:13 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > >
> > > While editing back branch patches, I realized that the following
> > > (parsed->xinfo & XACT_XINFO_HAS_INVALS) and (parsed->nmsgs > 0) are
> > > equivalent:
> > >
> > > +   /*
> > > +    * If the COMMIT record has invalidation messages, it could have catalog
> > > +    * changes. It is possible that we didn't mark this transaction as
> > > +    * containing catalog changes when the decoding starts from a commit
> > > +    * record without decoding the transaction's other changes. So, we ensure
> > > +    * to mark such transactions as containing catalog change.
> > > +    *
> > > +    * This must be done before SnapBuildCommitTxn() so that we can include
> > > +    * these transactions in the historic snapshot.
> > > +    */
> > > +   if (parsed->xinfo & XACT_XINFO_HAS_INVALS)
> > > +       SnapBuildXidSetCatalogChanges(ctx->snapshot_builder, xid,
> > > +                                     parsed->nsubxacts, parsed->subxacts,
> > > +                                     buf->origptr);
> > > +
> > >     /*
> > >      * Process invalidation messages, even if we're not interested in the
> > >      * transaction's contents, since the various caches need to always be
> > >      * consistent.
> > >      */
> > >     if (parsed->nmsgs > 0)
> > >     {
> > >         if (!ctx->fast_forward)
> > >             ReorderBufferAddInvalidations(ctx->reorder, xid, buf->origptr,
> > >                                           parsed->nmsgs, parsed->msgs);
> > >         ReorderBufferXidSetCatalogChanges(ctx->reorder, xid, buf->origptr);
> > >     }
> > >
> > > If that's right, I think we can merge these if branches. We can call
> > > ReorderBufferXidSetCatalogChanges() for top-txn and in
> > > SnapBuildXidSetCatalogChanges() we mark its subtransactions if top-txn
> > > is in the list. What do you think?
> > >
> >
> > Note that this code doesn't exist in 14 and 15, so we need to create
> > different patches for those.
>
> Right.
>

Okay, then this sounds reasonable to me.

-- 
With Regards,
Amit Kapila.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: RE: Skip partition tuple routing with constant partition key
Следующее
От: Peter Smith
Дата:
Сообщение: Re: Data is copied twice when specifying both child and parent table in publication