Re: pgsql: pg_rewind: Fetch small files according to new size.

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: pg_rewind: Fetch small files according to new size.
Date: 2022-04-06 08:44:50
Message-ID: 202204060844.l7zjinlqcwoq@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 2022-Apr-05, Daniel Gustafsson wrote:

> local_source.c:118:15: error: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
> srcpath, len, written_len);
> ~~~~~~~~~^~~~~~~~~~~~~~~~~
>
> I'm running a fixup with casting to int and printing with %d (like how
> pg_rewind.c:digestControlFile already does it for printing a size_t) through CI
> just to be sure and will push once it's had a green run:
>
> - pg_fatal("size of source file \"%s\" changed concurrently: " UINT64_FORMAT " bytes expected, " UINT64_FORMAT " copied",
> - srcpath, len, written_len);
> + pg_fatal("size of source file \"%s\" changed concurrently: %d bytes expected, %d copied",
> + srcpath, (int) len, (int) written_len);

Hmm, it is typical to cast file sizes to long long and print with %lld.
See d914eb347fcd for a recent example.

.. oh, I see you pushed already. Not sure this is worth fixing, since
the original commit message claimed to involve only "small files".

I suppose having a non-relation-file in the datadir that's bigger than
4GB is not expected?

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Essentially, you're proposing Kevlar shoes as a solution for the problem
that you want to walk around carrying a loaded gun aimed at your foot.
(Tom Lane)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-04-06 09:13:17 Re: API stability
Previous Message Alvaro Herrera 2022-04-06 08:30:32 Re: API stability