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 1nK7ih-0005tG-LC for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Feb 2022 23:58:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nK7ig-0001K0-JR for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Feb 2022 23:58:54 +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 1nK7ig-0001Jk-8h for pgsql-hackers@lists.postgresql.org; Tue, 15 Feb 2022 23:58:54 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nK7ib-0000kH-Ki for pgsql-hackers@postgresql.org; Tue, 15 Feb 2022 23:58:53 +0000 Received: by mail-pg1-x536.google.com with SMTP id z4so565856pgh.12 for ; Tue, 15 Feb 2022 15:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=s8lJnMz9AFdxW3HEEPRfC5nK9p8SS+7rLA6H6qyZ3kk=; b=pAemtSK2mNanNUCSDzsR4jKKEoJ2mY+mpn4JKCuATUgoLbOlED4NDOHmQGFxzmg/n2 0G2U9nKMRooQk01E2LZW5LD2+1vRTJlX8X4HWvxEo2GXyWwZumiyeuDUq4pcDUXX8JNB HqPwLnpC1bgXVAD5vTEclJMckqNW/4FeElo6fJGPkdQJk3MviA9E5cGlMsQ78EB3D9pf S/915XVVwlb3FezIwjjn73/Uk/Usxd8pX/WLTnrBTAs5MERjQen0F/QWRC8TjtIUoMZL 07l7P6ImSpHUqSUVJ2CUF8OnmBPu1g3qWIaYmBuheE5DF+N0WhWwlr+mlcj4jzq4ReJk MeqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=s8lJnMz9AFdxW3HEEPRfC5nK9p8SS+7rLA6H6qyZ3kk=; b=UgXqVVE567VLxUyY6q1Vc3jwxQw0u3e2aWXKPaP3c431/aFg8gC8lM6KyGrw8aKKzM GRFMv0fFbZ9ona48uUgrZDnyTTVuiZqIwWky8KLveKwwo0rzqKrbCepfX/nphk58H+gh fzIXMu2pz+/ncTbYqE67SJ6VL7QTf9VF41IQwSzInPbKFXU+ai+HRG8Wdt8b61ejIjut jWzBi2UgVY10gmQ+k9dfV2epOnLs1q7TNQb4WONmQvt1BUMwPbxyexnbCEWuOT+QUgSl 0JyYlVyvvjkqy/8RFHivEZi1f4ow2yCZO3GD49xCe989nq3lEQIiDtLnUH4KDCim6nt6 mAJw== X-Gm-Message-State: AOAM531aQFtApp/SsvtaPylxEjRuoMsOJiswrKrgJPYUJ4sFsdJ5gU5e vFj5nkHEOvR8Yimo8Mlq7Ygv8M8JlGs= X-Google-Smtp-Source: ABdhPJxSZfIcbCg7NUBcnfsdOWc5G+wtB8N5Pxby5RYrC7ux7EUR3fb2aVWT9LhRzIl2Kmm98dg7Kw== X-Received: by 2002:a63:dc49:0:b0:36f:e390:10a with SMTP id f9-20020a63dc49000000b0036fe390010amr4584pgj.535.1644969527858; Tue, 15 Feb 2022 15:58:47 -0800 (PST) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id lk11sm10153944pjb.31.2022.02.15.15.58.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 15:58:47 -0800 (PST) Date: Tue, 15 Feb 2022 15:58:45 -0800 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: USE_BARRIER_SMGRRELEASE on Linux? Message-ID: <20220215235845.GA2665318@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I've noticed that my WAL pre-allocation patches [0] routinely fail with "tablespace is not empty" errors on Linux [1]: DROP TABLESPACE regress_tblspace_renamed; +ERROR: tablespace "regress_tblspace_renamed" is not empty This appears to have been discussed elsewhere (and fixed) for Windows [2] [3] [4]. However, I'm able to reliably reproduce the issue on Linux when the WAL pre-allocation patches are applied. Adding a short sleep before dropping the tablespace or defining USE_BARRIER_SMGRRELEASE seems to clear up the issue. My current thinking is that the performance boost from pre-allocating WAL is revealing this issue, but I'm not 100% certain it's not due to a bug in my code. I'm continuing to investigate. [0] https://commitfest.postgresql.org/37/3158/ [1] https://api.cirrus-ci.com/v1/artifact/task/4678319084929024/log/src/test/regress/regression.diffs [2] https://postgr.es/m/CA%2BhUKGJp-m8uAD_wS7%2BdkTgif013SNBSoJujWxvRUzZ1nkoUyA%40mail.gmail.com [3] https://postgr.es/m/CA%2BhUKGLdemy2gBm80kz20GTe6hNVwoErE8KwcJk6-U56oStjtg%40mail.gmail.com [4] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4eb2176 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com