Re: Ensure temporary files are unlinked on errors in pg_receivewal

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Ensure temporary files are unlinked on errors in pg_receivewal
Date: 2026-11-24 14:39:17
Message-ID: CAHGQGwFrTOGj00cUoa55r4LK7hERdiu=jLa5fgTwBbdY-sd-WA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 23, 2026 at 6:13 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
>> This patch moves the CLOSE_UNLINK handling into the common cleanup path

Thanks for the patch!

> + int unlink_result = unlink(df->fullpath);
>
> We could save the variable assignment here if you want. Otherwise, LGTM.

+1. Attached is v2 with that change, along with a backpatch version for v15.

Barring any objections, I will commit the patch.

Regards,

--
Fujii Masao

Attachment Content-Type Size
v2-0001-pg_receivewal-pg_basebackup-Fix-temporary-file-cl.patch application/octet-stream 2.6 KB
nocfbot-v2-0001-pg_receivewal-pg_basebackup-Fix-temporary-file-cl-v15.patch application/octet-stream 2.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vedant Gharat 2026-11-24 14:39:43 Re: Check the fd number against FD_SETSIZE in PQsocketPoll
Previous Message Andrei Lepikhov 2026-11-24 14:36:12 Re: Use local buffer for packed numerics