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 1lVhXu-0002kL-Vk for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Apr 2021 21:23:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lVhXt-0004vE-Ib for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Apr 2021 21:23:05 +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 1lVhXt-0004v7-86 for pgsql-hackers@lists.postgresql.org; Sun, 11 Apr 2021 21:23:05 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lVhXq-00031s-BG for pgsql-hackers@lists.postgresql.org; Sun, 11 Apr 2021 21:23:04 +0000 Received: by mail-il1-x12e.google.com with SMTP id c15so9328373ilj.1 for ; Sun, 11 Apr 2021 14:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MfrKbM87mItv3PHJmfBDkk0sij2uKIWC/623wmReZYc=; b=E8JC7sCE9gOItb3HRb6w1uB8hHdpd/6J/MyVTOisrGdGIXSxBFsj8+Ew1HdmDKihDw zM8nWXaDOGXaEoOSs2LMbfNOz6Lg0BeQPezL7+1SGJrsFl+DlPUWze7GT5CtGkNuSITK ER/MPgQoWAhccspgSKqdB1d00S41f8iwXRHgSaAi1OEzCzxZEc+NKmzkAkSrIjWQ1JBP LaOfDK9axcERWg1dM8pAAgw8YwFIMvPI7W2mQdMhAwGlYQMpZq/fE5bj0KHG7WM9YLjf Hq6m5eJ2UrPrDM6Ztl9s0Q4G0mk5qUEDjI5vnZxATIbTvVP5h2omvzDO/iSuULLwMZni aYdg== 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=MfrKbM87mItv3PHJmfBDkk0sij2uKIWC/623wmReZYc=; b=RKOOPd1QRIr204slp3uL+uoYhnIwoa1nw7kGEdC0URDr9d46OvKe2tTazwwD/2fbhV hEmE4VJ0IuU/MdJ5WucI2vvFr/tbWJMbt75RV/lw/iMn1vuPNBBuZw/4wdxt7oM7bu+a XfB3rQru4h6NLV8gfBmvgk4jRchxtNeuC+8Dz6Fu6WWEJ3u5cygMl7+IVcGLDPN9Y6qx byTdHoTLtZ+hE1a8J0KEaY87794Y+ge+qhBZGMpnqSgVi/3dVweYaO8v7DKYbgH3arbJ mci/yAfUX7tVapfGL5w+2+riTimXhzI2apgHm34zWQ5B+IfGY4DH9GA0XYFuOR5FTf+g 3Eaw== X-Gm-Message-State: AOAM533Kqm/kppnd7vMXN7iEPSYs/IKJfrLzodTLy6bZyISKkHkg7yJU Peo5Vy2vnLjaktW4feCY41Sq2Q== X-Google-Smtp-Source: ABdhPJyT4HveoCm81haItvDZZW8YtkPTaXK8pXM1xK7CRvNN/upp+xjleVasjOgPVZYF3yYf4szh6A== X-Received: by 2002:a92:d811:: with SMTP id y17mr17910892ilm.221.1618176181452; Sun, 11 Apr 2021 14:23:01 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id s21sm1441868iog.24.2021.04.11.14.23.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Apr 2021 14:23:01 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 304F3800A3B; Sun, 11 Apr 2021 16:23:00 -0500 (CDT) Date: Sun, 11 Apr 2021 16:23:00 -0500 From: Justin Pryzby To: Alvaro Herrera Cc: Tom Lane , Amit Langote , pgsql-hackers@lists.postgresql.org Subject: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY Message-ID: <20210411212259.GB20530@telsasoft.com> References: <3269784.1617215412@sss.pgh.pa.us> <20210411212035.GA15048@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210411212035.GA15048@alvherre.pgsql> 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 Sun, Apr 11, 2021 at 05:20:35PM -0400, Alvaro Herrera wrote: > On 2021-Mar-31, Tom Lane wrote: > > > diff -U3 /home/buildfarm/trilobite/buildroot/HEAD/pgsql.build/src/test/isolation/expected/detach-partition-concurrently-4.out /home/buildfarm/trilobite/buildroot/HEAD/pgsql.build/src/test/isolation/output_iso/results/detach-partition-concurrently-4.out > > --- /home/buildfarm/trilobite/buildroot/HEAD/pgsql.build/src/test/isolation/expected/detach-partition-concurrently-4.out 2021-03-29 20:14:21.258199311 +0200 > > +++ /home/buildfarm/trilobite/buildroot/HEAD/pgsql.build/src/test/isolation/output_iso/results/detach-partition-concurrently-4.out 2021-03-30 18:54:34.272839428 +0200 > > @@ -324,6 +324,7 @@ > > 1 > > 2 > > step s1insert: insert into d4_fk values (1); > > +ERROR: insert or update on table "d4_fk" violates foreign key constraint "d4_fk_a_fkey" > > step s1c: commit; > > > > starting permutation: s2snitch s1b s1s s2detach s1cancel s3vacfreeze s1s s1insert s1c > > Hmm, actually, looking at this closely, I think the expected output is > bogus and trilobite is doing the right thing by throwing this error > here. The real question is why isn't this case behaving in that way in > every *other* animal. I was looking/thinking at it, and wondered whether it could be a race condition involving pg_cancel_backend() -- Justin