Re: Don't choke on files that are removed while pg_rewind runs.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Subject: Re: Don't choke on files that are removed while pg_rewind runs.
Date: 2020-07-13 12:18:24
Message-ID: 20200713121824.GB10826@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 13, 2020 at 10:12:54AM +0200, Daniel Gustafsson wrote:
> Does it? PGgetvalue will return an empty string and not NULL, so atol will
> convert that to zero wont it? It can be argued whether zero is the right size
> for a missing file, but it shouldn't crash at least.

Nay, you are right. Thanks.

> It does convey the meaning of code to do it after, since the data isn't useful
> in case the filesize is zero, but I don't have strong feelings for/against.
> Question is, rather than discard rows pulled from the server, should the query
> be tweaked to not include it in the first place instead?

That sounds like a good idea with an extra qual in the first part of
the inner CTE, if coupled with a check to make sure that we never
get a NULL result. Now there is IMO an argument to not complicate
more this query as it is not like a lot of tuples would get filtered
out anyway because of a NULL set of values? I don't have strong
feelings for one approach or the other, but if I were to choose, I
would just let the code as-is, without the change in the CTE.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Naresh gandi 2020-07-13 12:20:51 Re: Additional Chapter for Tutorial
Previous Message David Rowley 2020-07-13 12:16:45 Re: Default setting for enable_hashagg_disk