Re: pg_rewind WAL segments deletion pitfall

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>
Cc: Sutou Kouhei <kou(at)clear-code(dot)com>, smithpb2250(at)gmail(dot)com, torikoshia(at)oss(dot)nttdata(dot)com, horikyota(dot)ntt(at)gmail(dot)com, michael(at)paquier(dot)xyz, pgsql-hackers(at)postgresql(dot)org, bungina(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_rewind WAL segments deletion pitfall
Date: 2024-11-15 12:22:21
Message-ID: 202411151222.7qbg5ujnrnxt@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hello Alexander,

On 2024-Nov-14, Alexander Kukushkin wrote:

> The commit message looks good to me, except maybe using a "master" word,
> which I would suggest to replace with "primary".

Oh wow, thanks for noticing that. I had already rewritten the commit
message to some extent, but "master" had remained. Now I pushed the
patch to branches 14+, having replaced it as you suggested.

(This reminds me that I used to have a notification set in the
2ndQuadrant Mattermost instance so that I could LART anybody who used
the words 'master' or 'slave' in the chats there).

> + /*
> + * This hash table is empty in the vast majority of cases, so set an
> + * initial size of 0.
> + */
> + keepwal = keepwal_create(0, NULL);
> +}
>
> I don't think that the hash table will be empty. It needs to hold all WAL
> filenames starting from the last checkpoint and up to divergent point.
> On loaded clusters it could be hundreds and thousands of files.

Oh, okay. The initial size is just there to avoid having to grow the
hash table, but using the same constant that we use for the filemap hash
table seems good enough ... it shouldn't make much of a difference in
practice.

Regards

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
<Schwern> It does it in a really, really complicated way
<crab> why does it need to be complicated?
<Schwern> Because it's MakeMaker.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Aleksander Alekseev 2024-11-15 12:51:08 Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Previous Message zengman 2024-11-15 11:28:25 Re:BUG #18710: "pg_get_viewdef" triggers assertions in special scenarios

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-11-15 12:39:15 Re: Interrupts vs signals
Previous Message Man Zeng 2024-11-15 12:06:41 Re: [PATCH] Fixed assertion issues in "pg_get_viewdef"