pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory

From: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory
Date: 2022-01-03 05:27:43
Message-ID: CAHg+QDcVUss6ocOmbLbV5f4YeGLhOCt+1x2yLNfG2H_eDwU8tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

I noticed that pg_receivewal fails to stream when the partial file to write
is not fully initialized and fails with the error message something like
below. This requires an extra step of deleting the partial file that is not
fully initialized before starting the pg_receivewal. Attaching a simple
patch that creates a temp file, fully initialize it and rename the file to
the desired wal segment name.

"error: write-ahead log file "000000010000000000000003.partial" has 8396800
bytes, should be 0 or 16777216"

Thanks,
Satya

Attachment Content-Type Size
pg_receivewal_init_fix.patch application/octet-stream 3.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2022-01-03 05:46:24 RE: Failed transaction statistics to measure the logical replication progress
Previous Message Nikhil Benesch 2022-01-03 04:47:32 Remove inconsistent quotes from date_part error