Re: Newly created replication slot may be invalidated by checkpoint
От | Amit Kapila |
---|---|
Тема | Re: Newly created replication slot may be invalidated by checkpoint |
Дата | |
Msg-id | CAA4eK1JD3nvg-w3X2XguR3DZc_NjrHT+pFeyJ1XYh+dDhk7LoQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Newly created replication slot may be invalidated by checkpoint (Amit Kapila <amit.kapila16@gmail.com>) |
Ответы |
RE: Newly created replication slot may be invalidated by checkpoint
|
Список | pgsql-hackers |
On Tue, Sep 23, 2025 at 12:19 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Wed, Sep 17, 2025 at 4:19 PM Vitaly Davydov <v.davydov@postgrespro.ru> wrote: > > > > [1] 0001-Fix-invalidation-when-slot-is-created-during-checkpo.patch > > > > - /* Calculate how many segments are kept by slots. */ > - keep = slotsMinReqLSN; > + /* > + * Calculate how many segments are kept by slots. Keep the wal using > + * the minimal value from the current reserved LSN and the reserved LSN at > + * the moment of checkpoint start (before CheckPointReplicationSlots). > + */ > + keep = XLogGetReplicationSlotMinimumLSN(); > + if (!XLogRecPtrIsInvalid(slotsMinReqLSN)) > + keep = Min(keep, slotsMinReqLSN); > > Can we add why we need this additional calculation here? > I was thinking some more about this solution. Won't it lead to the same problem if ReplicationSlotReserveWal() calls ReplicationSlotsComputeRequiredLSN() after the above calculation of checkpointer? -- With Regards, Amit Kapila.
В списке pgsql-hackers по дате отправления: