| From: | Jesper St John <jesper(at)stjohn(dot)se> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org, Jesper St John <admin(at)zonezero(dot)se>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Magnus Hagander <magnus(at)hagander(dot)net>, Kirill Reshke <reshkekirill(at)gmail(dot)com> |
| Subject: | Re: Timing issue in pg_basebackup |
| Date: | 2026-11-24 13:06:31 |
| Message-ID: | d665de0d6ef174829817d7b197563446@stjohn.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On 2026-11-23 23:16, Zsolt Parragi wrote:
> On Mon, 23 Nov 2026, Jesper St John <jesper(at)stjohn(dot)se> wrote:
>> But it seems that in master today, a previously created slot which
>> would
>> be specified by --slot and not --create-slot could also be invalidated
>> if a tiny idle_replication_slot_timeout is set.
>
> It seems like a new behavior to me with --create-slot (I agree that it
> is preexisting with --slot).
Ok, fair. I think the idle_replication_slot_timeout needs some more
documentation though.
>
> Also, --create-slot leaves the slot behind in this case, which is also
> new. And this happens in two more cases: when the connection is lost
> and when the process is killed with SIGINT/SIGTERM during the
> checkpoint.
>
Yes.
> The new hint can also be misleading in some cases:
>
> PGOPTIONS='-c idle_session_timeout=2s' pg_basebackup -X stream
> --checkpoint=spread (no slot invalidated in the server log)
> pg_basebackup: warning: replication slot "pg_basebackup_664448" was
> invalidated during the base backup checkpoint, recreating it
> pg_basebackup: hint: You might need to increase
> "max_slot_wal_keep_size".
>
> I am not sure if this is bad or not, because that is probably the more
> common case of why is this happening, and the hint says 'might', so it
> might be okay.
It can be rephrased.
What if we create a temp slot before running base backup and then drop
it and create a new slot if needed as it is done today? That way it
shouldn't be hit by idle_replication_slot_timeout and any sigint/sigterm
would not leave the slot behind.
The patch might be smaller...
The idle_session_timeout of something smaller than the time it takes to
do checkpoint=spread would probably recreate the timing issue with temp
slot- so perhaps that could be overriden?
Any thoughts before I start exploring?
//Jesper
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniel Gustafsson | 2026-11-24 14:17:57 | Re: macaddr8 accepts one trailing character after a complete address |
| Previous Message | Daniel Gustafsson | 2026-11-24 13:01:19 | Re: BUG #19354: JOHAB rejects valid byte sequences |