Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onRMF-0006Q6-H0 for pgsql-committers@arkaria.postgresql.org; Tue, 25 Oct 2022 21:21:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1onRME-0005vU-D3 for pgsql-committers@arkaria.postgresql.org; Tue, 25 Oct 2022 21:21:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onRME-0005vL-2t for pgsql-committers@lists.postgresql.org; Tue, 25 Oct 2022 21:21:10 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1onRM8-0000N5-UB for pgsql-committers@lists.postgresql.org; Tue, 25 Oct 2022 21:21:09 +0000 Received: by mail-il1-x131.google.com with SMTP id d14so7663512ilf.2 for ; Tue, 25 Oct 2022 14:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=fCjtp9YlhV718bzePW6iVQWnjzJ+8G997n/emTH2FWk=; b=J9VnJhO+Jw/XCw4cFU3CbHUBU6q3BqC5FZGY6qWqvrIPL8ksGPIfQzNfPMOAPe1HyM D/02maykRFm4QqeOJeT9B8RMu+5ZP25bwEEPHgLBWTMYulJRuDCFMz8OOCh0uNHRcMRU HkDNlPSHg9AyW2eI+NtWAviT4qM4zkQEwGxwQva1xRha/Fx8YkxsifUUo0GLwdMirZbj 8WwYXaL5E/iDAR3JcIU49MD1L9ztn1Uxzob1F7xYlR9qMtxnuMBJhWQuY8r/SG7efZC6 PWQWBgm9OAxFtpDWkJ3l+Z68Zs63I0RVgyYRHJ6QvVVGE6+ETqRgSrqrDSeGHZ3JeXze mTBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fCjtp9YlhV718bzePW6iVQWnjzJ+8G997n/emTH2FWk=; b=rpZOYLGaYQM86jLqJ6nRDNUcnT1924BDLzWrSdEl8XKVud1xD0xCUHEut6TAcR5Kyx 5pGLjyLNTwDjiOXIyiAd4SWJoAMpiHHGNZHwd7scwR33TvWs6x5UQgFzugU9DOeIe7RP kK2XW68XQKq93AFwFNlplMdd892p4FVJ8L/MZ0JzIINBVUP55u9evGmDPemtAliyO8og sChnssjxrQKG8DN/BdatRpR/8qKLblYVDfHzDsLQ4Oxqk/1NhExFCcdV3Si/Glwu49wV JU1sMjXxP4LRnC8qThxMYXX24zGj3SyOiRBsPqeR/Nvaa3CzhDQw0q9GIp0lPL6kKORG FBFQ== X-Gm-Message-State: ACrzQf2ptfv/5xlXOn5cUW6G9wSHstNAM4J1BNqsWND6HgQocKra0akH OjFqv5ifdMtLN2z+ddZHmHrInPFZsAyJsA== X-Google-Smtp-Source: AMsMyM7BQ4GvQxIWeFwzVrypp773f6bqZ878nlYf0NFjVelLUprVTbcIoYtVe/N68rdrCfSOp7qGkA== X-Received: by 2002:a92:b00d:0:b0:2f8:ed7d:88e7 with SMTP id x13-20020a92b00d000000b002f8ed7d88e7mr23330643ilh.61.1666732863757; Tue, 25 Oct 2022 14:21:03 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id h18-20020a056602155200b006bbddd49984sm1539916iow.9.2022.10.25.14.21.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2022 14:21:03 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 736258007FB; Tue, 25 Oct 2022 16:21:02 -0500 (CDT) Date: Tue, 25 Oct 2022 16:21:02 -0500 From: Justin Pryzby To: Thomas Munro Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix unlink() for STATUS_DELETE_PENDING on Windows. Message-ID: <20221025212102.GS16921@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 > Reviewed-by: Michael Paquier > 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