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 1lWBio-00046Q-Bb for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Apr 2021 05:36:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lWBim-0006CB-As for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Apr 2021 05:36:20 +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 1lWBil-0006C4-Sm for pgsql-hackers@lists.postgresql.org; Tue, 13 Apr 2021 05:36:20 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lWBii-0000FC-3j for pgsql-hackers@lists.postgresql.org; Tue, 13 Apr 2021 05:36:19 +0000 Received: by mail-pl1-x62b.google.com with SMTP id z22so2464617plo.3 for ; Mon, 12 Apr 2021 22:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=m1ITzz5aVD/jvt5/zEMf3QcXudLW4JAAE9rRlEcRFsw=; b=Gi23aJ6VFgyMw0SxhqXtztYwIL49D98yi/Mpqp8ldL/QcLtVm6RzNgTcr9k2i1Y2tx NQ1JEAmAcOHcjYJTVCcwaAOR7UeFL8w2SwEzar0MyLbznWb27sAjeJcY7OtzfHl13wiE /E2cJViJLcbg19W80MIJeJfLg9vsT2e9QufpA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=m1ITzz5aVD/jvt5/zEMf3QcXudLW4JAAE9rRlEcRFsw=; b=J2rEqv0YrTCs2zJN2oLnWN+oZ95Y4tIrABPbHKyI4RyP64W4KESCP4QUtJjVsMTP1y VBP+do5dr7q3vCDjUzAyzmcH+S2K0g0FsLvB7Ur7naU8GfpFOFz30SOQhqfQxNK5QwaG KYwIt0HjA5JuiAk+jXGvSWkz5mfjy+o9Hr6z1r2ZUqL8PPyiPms8NTrDWgaTUcVFCRrE GuzQ0AcT0wx1ma65Ol2aKP1R37g0vnqaMXrhE1CBrgtRjfDOmNhf1TY6kpeEdjLENRHb MXtsCAXqjDiwTzL928VRiQ18RruJfL3G/2msRDStiu7iXDE62Pln5DhFpmJ9qTDUfAdr sP8A== X-Gm-Message-State: AOAM532DGU0P6pCjahhSTn35mll5ZgzsKPyEAma+L+lxClfRhO7wZlhF xHHQZqp1ntkEeHEmiAYLsXX4Vw== X-Google-Smtp-Source: ABdhPJz30oC1YcmXVxZIaQZ0f/GrrbDgfpkxy6fDg+v5yu12cfVNLDkWWey9Dr3WfyfRowD4ttMq1w== X-Received: by 2002:a17:903:22c7:b029:e6:faf5:eb3a with SMTP id y7-20020a17090322c7b02900e6faf5eb3amr30438393plg.23.1618292173717; Mon, 12 Apr 2021 22:36:13 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id p2sm12763336pgm.24.2021.04.12.22.36.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Apr 2021 22:36:12 -0700 (PDT) Date: Mon, 12 Apr 2021 22:36:10 -0700 From: Noah Misch To: Michael Paquier Cc: Robert Haas , Christoph Berg , PostgreSQL Hackers Subject: Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres Message-ID: <20210413053610.GB1139770@rfd.leadboat.com> References: <20210325025659.GA4017435@rfd.leadboat.com> <20210410030710.GB978274@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 12, 2021 at 02:25:53PM +0900, Michael Paquier wrote: > On Fri, Apr 09, 2021 at 08:07:10PM -0700, Noah Misch wrote: > > "pg_regress --outputdir" is not a great location for a file or directory > > created by a user other than the user running pg_regress. If one does "make > > check" and then "make installcheck" against a cluster running as a different > > user, the rmtree() will fail, assuming typical umask values. An rmtree() at > > the end of the tablespace test would mostly prevent that, but that can't help > > in the event of a mid-test crash. > > Yeah, I really don't think that we need to worry about multi-user > scenarios with pg_regress like that though. Christoph Berg's first message on this thread reported doing that. If supporting server_user!=pg_regress_user is unwarranted and Christoph Berg should stop, then already-committed code suffices. > > I'm not sure we should support installcheck against a server running as a > > different user. If we should support it, then I'd probably look at letting > > the caller pass in a server-writable directory. That directory would house > > the tablespace instead of outputdir doing so. > > But, then, we would be back to the pre-13 position where we'd need to > have something external to pg_regress in charge of cleaning up and > creating the tablespace path, no? Correct. > That's basically what we want to > avoid with the Makefile rules. The race that commit 6c788d9 fixed is not inherent to Makefile rules. For example, you could have instead caused test.sh to issue 'make installcheck-parallel TABLESPACEDIR="$outputdir"/testtablespace' and have the makefiles consult $(TABLESPACEDIR) rather than hard-code ./testtablespace. (That said, I like how 6c788d9 consolidated Windows and non-Windows paths.) > I can get that it could be interesting > to be able to pass down a custom path for the test tablespace, but do > we really have a need for that? I don't know. I never considered server_user!=pg_regress_user before this thread, and I don't plan to use it myself. Your latest patch originated to make that case work, and my last message was reporting that the patch works for a rather-narrow interpretation of server_user!=pg_regress_user, failing on variations thereof. That might be fine.