Re: pg_basebackup -F t fails when fsync spends more time thantcp_user_timeout - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_basebackup -F t fails when fsync spends more time thantcp_user_timeout
Date
Msg-id 20190902064057.GD1841@paquier.xyz
Whole thread Raw
In response to pg_basebackup -F t fails when fsync spends more time thantcp_user_timeout  ("r.takahashi_2@fujitsu.com" <r.takahashi_2@fujitsu.com>)
Responses RE: pg_basebackup -F t fails when fsync spends more time thantcp_user_timeout
List pgsql-hackers
On Mon, Sep 02, 2019 at 04:42:55AM +0000, r.takahashi_2@fujitsu.com wrote:
> I think fsync() for each tablespace is not necessary.
> Like pg_basebackup -F p, I think fsync() is necessary only once at the end.

Yes, I agree that we overlooked that part when introducing
tcp_user_timeout.  It is possible to sync all the contents of
pg_basebackup's tar format once at the end with fsync_dir_recurse().

Looking at the original discussion that brought bc34223b, the proposed
patches did what we have now on HEAD but we did not really exchange
about doing a fsync() just at the end with all the result base
directory contents:
https://www.postgresql.org/message-id/CAB7nPqQL0fCp0eDcVD6+3+Je24xeApU14vKz_pBpNA0sTPwLgQ@mail.gmail.com

Attached is a patch to do that, which should go down to v12 where
tcp_user_timeout has been introduced.  Takahashi-san, what do you
think?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: pg_dump --exclude-* options documentation
Next
From: Michael Paquier
Date:
Subject: Re: SIGQUIT on archiver child processes maybe not such a hot idea?