pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Thomas Munro <tmunro@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix unlink() for STATUS_DELETE_PENDING on Windows.
Date: Tue, 25 Oct 2022 16:21:02 -0500
Message-ID: <20221025212102.GS16921@telsasoft.com> (raw)
In-Reply-To: <E1onAdK-000gt6-BV@gemulon.postgresql.org>
References: <E1onAdK-000gt6-BV@gemulon.postgresql.org>

On Tue, Oct 25, 2022 at 03:29:42AM +0000, Thomas Munro wrote:
> Fix unlink() for STATUS_DELETE_PENDING on Windows.
> 
> Commit f357233c assumed that it was OK to return ENOENT directly if
> lstat() failed that way.  If we got STATUS_DELETE_PENDING while trying
> to unlink a file that we had already unlinked successfully once before
> but someone else still had open (on a kernel version that has "pending"
> unlinks by default), then we would no longer reach the retry loop in
> pgunlink().  That loop claims to be only for handling sharing violations
> (a different phenomenon), but the errno is the same.
> 
> Restore that behavior with an explicit check, to see if it fixes the
> occasional 'directory not empty' failures seen in the pg_upgrade tests
> on CI.  Further improvements are possible with proposed upgrades to
> modern Windows APIs that would replace this convoluted code.
> 
> Reported-by: Justin Pryzby <pryzby@telsasoft.com>
> Reviewed-by: Michael Paquier <michael@paquier.xyz>
> Discussion: https://postgr.es/m/20220920013122.GA31833%40telsasoft.com
> Discussion: https://postgr.es/m/CA%2BhUKG%2BajSQ_8eu2AogTncOnZ5me2D-Cn66iN_-wZnRjLN%2Bicg%40mail.gmail.com
...
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/e109e43921d21d069c03f18d7c9d8f4e5cb6a0c3

If I'm not wrong, this didn't fix the issue you said it fixed.

cfbot says this ran 1h ago, and its HEAD^3 is e109e43.
https://cirrus-ci.com/task/5939314583404544





view thread (7+ messages)  latest in thread

Message-ID: <20221025212102.GS16921@telsasoft.com>
Permalink:  ../20221025212102.GS16921@telsasoft.com/
Also on:    postgresql.org/message-id/20221025212102.GS16921@telsasoft.com

 · 

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: pryzby@telsasoft.com, tmunro@postgresql.org
  Subject: Re: pgsql: Fix unlink() for STATUS_DELETE_PENDING on Windows.
  In-Reply-To: <20221025212102.GS16921@telsasoft.com>
  References: <E1onAdK-000gt6-BV@gemulon.postgresql.org> <20221025212102.GS16921@telsasoft.com>

* 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