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 1kdfEw-00028Y-F0 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Nov 2020 20:00:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdfEv-00009C-4g for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Nov 2020 20:00:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdfEu-000094-RX for pgsql-hackers@lists.postgresql.org; Fri, 13 Nov 2020 20:00:08 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kdfEq-0008Df-If for pgsql-hackers@postgresql.org; Fri, 13 Nov 2020 20:00:08 +0000 Received: by mail-lj1-x242.google.com with SMTP id v20so12232863ljk.8 for ; Fri, 13 Nov 2020 12:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=OJBbrfgOAtzFzo23NvWomn1hdwM8eS2jRscQgZmE6Z8=; b=dzGxCcQgJGvVRxDvfxBQkbu2GCf69y0npbzTcqTFwFYtxL0eKtuuTJcKE51NzABlIo O0K/uFLMi/GXiRp8V3UU4MCj+XiHXYAwIAqiAk8H44/Mbnb0t+RK6uFVVv8Uf3t+/zOp WIQcGPxLYhyFeETLTExrIMQAo3IkH7LCfyTigY/QCGbsMeg2XLKJmBvilOBKgMSdYkWw JurM41SBxXNhsqmEeLJANz1VvD1c+G6RWx+b60MrwV+ApF14Oq4VtG4jyDXbzXYs49Dl dM1Ox4hZPj833fYtmZKrK+PwH9lqhgKkQ8HYvClrlj/a0eUtIrbgsk8hVsV4cZNnyYbe dAPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=OJBbrfgOAtzFzo23NvWomn1hdwM8eS2jRscQgZmE6Z8=; b=YdIgGg6DbbANEXfQa/4Y7g4bL73Y8K16h28IiD/k/Ba3rv+W4O7NfeW9LcnyGBHcNo rokZCF1OYxbqDYpnpfofYIdQ2aNI+AX6FVV6uj3MJ3j0/rZxAGGE/Sw70+yrnXrmvVOg Sg13S8HNbHlPKOrcy/IJoAHsddy8u/ZtLf0xOvosLrNbPK0oDkxP/J+qpRDiv+cVjL9b jLQuN45vypceuiXFngFaWSEEqwfcSe42b5mtk9AGgSXL9CkZpu+ZvhQwrBf+rM13t7Dq 7QvgSA5HJTj46J44eYqoQimpxPJzHoL2E8JQYISDdk642W+d4bVqZ0ZynAk5NUtcOhzb LtKQ== X-Gm-Message-State: AOAM533hnzZ+j48rn+tlxG++nno5cJuetW8zJOz2kItc9Q+vWh+IvPBv T6kTuBuX2ms37nfiJMKbz/E= X-Google-Smtp-Source: ABdhPJwFV7atwytiPqLHh6pD0nPJmKFESMCzpe3QyTvziwIDNWwbS6ybIMr1CUH8EJKJyQfrMp/15g== X-Received: by 2002:a2e:2f07:: with SMTP id v7mr1629767ljv.455.1605297603438; Fri, 13 Nov 2020 12:00:03 -0800 (PST) Received: from [1.0.0.7] ([178.155.6.8]) by smtp.gmail.com with ESMTPSA id k9sm1655924lfk.288.2020.11.13.12.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Nov 2020 12:00:02 -0800 (PST) Subject: Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction To: Tom Lane , Justin Pryzby Cc: Fabien COELHO , pgsql-hackers@postgresql.org, Alvaro Herrera , David Steele , "Bossart, Nathan" , Thomas Munro References: <24244.1585415634@sss.pgh.pa.us> <20200328183904.GI20103@telsasoft.com> <28906.1585422475@sss.pgh.pa.us> <27064.1585499825@sss.pgh.pa.us> <20200329171415.GL20103@telsasoft.com> <29512.1585502524@sss.pgh.pa.us> <20200329201215.GM20103@telsasoft.com> <4028.1585579463@sss.pgh.pa.us> <20200331080643.GE14618@telsasoft.com> <11882.1585672910@sss.pgh.pa.us> From: Alexander Lakhin Message-ID: <83048c77-2531-48cb-aa2b-aa01cc5af519@gmail.com> Date: Fri, 13 Nov 2020 23:00:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <11882.1585672910@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello hackers, 31.03.2020 19:41, Tom Lane wrote: > Justin Pryzby writes: >> I suggest to leave stat() alone in your patch for stable releases. I think >> it's okay if we change behavior so that a broken symlink is skipped instead of >> erroring (as a side effect of skipping ENOENT with stat()). But not okay if we >> change pg_ls_logdir() to hide symlinks in back braches. > Meh. I'm not really convinced, but in the absence of anyone expressing > support for my position, I'll do it that way. I don't think it's worth > doing both a stat and lstat to tell the difference between file-is-gone > and file-is-a-broken-symlink. As we've discovered in Bug #[16161], stat() for "concurrently-deleted file" can also return ERROR_ACCESS_DENIED on Windows. It seems that pg_upgradeCheck failures seen on https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=fairywren&br=REL_13_STABLE caused by the same issue. Shouldn't pg_ls_dir_files() retry stat() on ERROR_ACCESS_DENIED just like the pgwin32_open() does to ignore files in "delete pending" state? [16161] https://www.postgresql.org/message-id/16161-7a985d2f1bbe8f71%40postgresql.org Best regards, Alexander