Re: archive status ".ready" files may be created too early

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "alvherre(at)alvh(dot)no-ip(dot)org" <alvherre(at)alvh(dot)no-ip(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "x4mmm(at)yandex-team(dot)ru" <x4mmm(at)yandex-team(dot)ru>, "a(dot)lubennikova(at)postgrespro(dot)ru" <a(dot)lubennikova(at)postgrespro(dot)ru>, "hlinnaka(at)iki(dot)fi" <hlinnaka(at)iki(dot)fi>, "matsumura(dot)ryo(at)fujitsu(dot)com" <matsumura(dot)ryo(at)fujitsu(dot)com>, "masao(dot)fujii(at)gmail(dot)com" <masao(dot)fujii(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: archive status ".ready" files may be created too early
Date: 2021-08-31 18:09:36
Message-ID: 20DC0D7B-E2DE-46BF-9DE4-D4D53A37E97D@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/31/21, 10:21 AM, "Andres Freund" <andres(at)anarazel(dot)de> wrote:
> What would trigger the flushing? We don't write out partially filled pages
> unless
> a) we're explicitly flushing an LSN on the partial page (e.g. because a
> synchronous commit record resides on it)
> b) there's an async commit (i.e. commit with synchronous_commit=off) on the
> page

Ah, so your point is that an open transaction that has written a
partial page on the next segment wouldn't trigger a flush. What
appears to happen in this case is that bgwriter eventually creates a
xl_running_xacts record and nudges walwriter to flush it to disk, at
which point the .ready file(s) will be created. That's admittedly a
bit fragile.

Nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2021-08-31 18:32:47 mark the timestamptz variant of date_bin() as stable
Previous Message Tomas Vondra 2021-08-31 17:50:58 Re: Bug fix for cache lookup failure for statistic_ext type