Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "tomas(at)vondra(dot)me" <tomas(at)vondra(dot)me>
Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Date: 2025-06-17 02:54:41
Message-ID: CALDaNm3s-jpQTe1MshsvQ8GO=TLj233JCdkQ7uZ6pwqRVpxAdw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Alexander,

While tracking buildfarm for one of other commits, I noticed this failure:
TRAP: failed Assert("s->data.restart_lsn >=
s->last_saved_restart_lsn"), File:
"../pgsql/src/backend/replication/slot.c", Line: 1813, PID: 3945797
postgres: standby: checkpointer (ExceptionalCondition+0x83) [0x55fa69b79f5e]
postgres: standby: checkpointer
(InvalidateObsoleteReplicationSlots+0x53c) [0x55fa69982171]
postgres: standby: checkpointer (CreateCheckPoint+0x9ad) [0x55fa6971feb2]
postgres: standby: checkpointer (CheckpointerMain+0x4b1) [0x55fa6996431c]
postgres: standby: checkpointer (postmaster_child_launch+0x130) [0x55fa69964b41]
postgres: standby: checkpointer (+0x40a1a7) [0x55fa699671a7]
postgres: standby: checkpointer (PostmasterMain+0x1563) [0x55fa6996aed6]
postgres: standby: checkpointer (main+0x7f0) [0x55fa6989f798]
/lib/x86_64-linux-gnu/libc.so.6(+0x29ca8) [0x7f1876a54ca8]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f1876a54d65]
postgres: standby: checkpointer (_start+0x21) [0x55fa696421a1]

Scorpion is failing for pg_basebackup's 020_pg_receivewal test at [1].
[1] - https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=scorpion&dt=2025-06-17%2000%3A40%3A46&stg=pg_basebackup-check

Regards,
Vignesh

On Mon, 16 Jun 2025 at 16:47, Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
>
> Dear Kuroda-san,
>
> On Mon, Jun 16, 2025 at 12:11 PM Hayato Kuroda (Fujitsu)
> <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> > Thanks for pushing the fix patch! BTW, I have few comments for your commits.
> > Can you check and include them if needed?
> >
> > 01.
> > ```
> > $node->append_conf('postgresql.conf',
> > "shared_preload_libraries = 'injection_points'");
> > ```
> >
> > No need to set shared_preload_libraries in 046/047. ISTM it must be set when we
> > enable the statistics.
> >
> > 02.
> > We should also check whether the injection_points can be installed or not.
> > You can check check_extension() and callers.
>
> Thank you! All of these totally make sense. The updated patch is attached.
>
> ------
> Regards,
> Alexander Korotkov
> Supabase

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-06-17 02:58:04 Re: pg_upgrade fails with an error "object doesn't exist"
Previous Message Tom Lane 2025-06-17 02:46:10 Re: BackendKeyData is mandatory?