Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory - Mailing list pgsql-hackers

From Cary Huang
Subject Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory
Date
Msg-id 164876406444.1182.11596302572557875100.pgcf@coridan.postgresql.org
Whole thread Raw
In response to Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory  (SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>)
List pgsql-hackers
Hello

pg_receivewal creates this .partial WAL file during WAL streaming and it is already treating this file as a temporary
file.It will fill this .partial file with zeroes up to 16777216 by default before streaming real WAL data on it. 
 

If your .partial file is only 8396800 bytes, then this could mean that pg_receivewal is terminated abruptly while it is
appendingzeroes or your system runs out of disk space. Do you have any error message? 
 

If this is case, the uninitialized .partial file should still be all zeroes, so it should be ok to delete it and have
pg_receivewalto recreate a new .partial file.
 

Also, in your patch, you are using pad_to_size argument in function dir_open_for_write to determine if it needs to
createa temp file, but I see that this function is always given a pad_to_size  = 16777216 , and never 0. Am I missing
something?

Cary Huang
===========
HighGo Software Canada

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
Next
From: Justin Pryzby
Date:
Subject: Re: head fails to build on SLES 12 (wal_compression=zstd)