pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Daniel Gustafsson <dgustafsson@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: pg_rewind: Fetch small files according to new size.
Date: Wed, 6 Apr 2022 10:44:50 +0200
Message-ID: <202204060844.l7zjinlqcwoq@alvherre.pgsql> (raw)
In-Reply-To: <D95829A7-630F-4CB8-AD32-C450210F606A@yesql.se>

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)





view thread (5+ messages)  latest in thread

Message-ID: <202204060844.l7zjinlqcwoq@alvherre.pgsql>
Permalink:  ../202204060844.l7zjinlqcwoq@alvherre.pgsql/
Also on:    postgresql.org/message-id/202204060844.l7zjinlqcwoq@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, daniel@yesql.se, dgustafsson@postgresql.org
  Subject: Re: pgsql: pg_rewind: Fetch small files according to new size.
  In-Reply-To: <202204060844.l7zjinlqcwoq@alvherre.pgsql>
  References: <D95829A7-630F-4CB8-AD32-C450210F606A@yesql.se> <202204060844.l7zjinlqcwoq@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox