Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gr8OI-0001KD-5y for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Feb 2019 21:36:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gr8OG-0008GM-R4 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Feb 2019 21:36:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gr8Kv-0007cp-5b for pgsql-hackers@lists.postgresql.org; Tue, 05 Feb 2019 21:32:57 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gr8Kr-0003c3-NP for pgsql-hackers@postgresql.org; Tue, 05 Feb 2019 21:32:56 +0000 Received: by mail-wm1-x342.google.com with SMTP id y139so446374wmc.5 for ; Tue, 05 Feb 2019 13:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=NG5L3hh1wA5HVxfXhslLmwZ+6UAg4zj+Jj8ySYYaRYc=; b=Ua3PIEgIDlf754WqHM3yGE06k4+ohhhsPpojwFUFkQEe/khD18LDziuhoZd8ZWF5kN plF/cPEolZiLRlk4/5wGIE8s34O5ybAHVIhNXxdY1lEBqpNbgg6BvoZMYRAyYwAyQfGR ZmQFRN43oUEBR0syCUisgvnR1YAj6fTFqC/kLMsRNO3/SHettkd24uGqQYERqvkotzGg OsfJCBlURj7mUXf89uWyBY6S1KwGYbs+c2EHFB3h+0yKdYyp93zaWee2HW6gT1ChPgID Aix20FxbkKxPAxO3/8FHVyA1IO8dx/OaTy342D1Bc6BsM7niXs1CeNs/lyi0n4N6jwXZ u6OQ== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=NG5L3hh1wA5HVxfXhslLmwZ+6UAg4zj+Jj8ySYYaRYc=; b=QNExifEC0DVpeDW46w1M+h0YjDhNGTkDK95xG4gmRbpCKJdT/aSMqC/7788D9I3fdS a+cNL7JTbUV44UDa0fbAK3f2SC1G/IDFdezRzYHOC0iE/VN6pU+oYjH97B7kNq8etX9q ev3INESLCmNVfHNim0hyuMTioY0KdPFh7+941llHxLuzE4UOLj42nxKM8tRUB4nrrnyr 8/u9IKqqMI83L7+BkmjCr6XnLBu49eXHAfyLDBBHAhFX+kfnmPSHe+bdJGwjluya1S4P GoauzJS0wmeSDbiTioZ5IXZkgCosHoSyjq4LIe1AWEcNYbdCfjzyT96pQ/QdgO08+MEr SG+Q== X-Gm-Message-State: AHQUAub8ismNLeXKnj5HPEW3GDfzzBUZZESewqcr+5i6u9euL56BeR/f 3//bzok2vlUlcHaEVwmrQypvEBkJpU8l/w== X-Google-Smtp-Source: AHgI3IY2w6RpvEQBvCcWBAqaDFA8pW4eHEz2rPaWZY4Vi/GNG2HXznJWlFnWxm5P98yElYGiugoaSQ== X-Received: by 2002:a7b:cb86:: with SMTP id m6mr506342wmi.61.1549402371555; Tue, 05 Feb 2019 13:32:51 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([212.145.226.69]) by smtp.gmail.com with ESMTPSA id a8sm18504023wme.23.2019.02.05.13.32.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Feb 2019 13:32:50 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 07F8C124587; Tue, 5 Feb 2019 18:11:19 -0300 (-03) Date: Tue, 5 Feb 2019 18:11:19 -0300 From: Alvaro Herrera To: Arseny Sher Cc: pgsql-hackers , Alexander Lakhin Subject: Re: Too rigorous assert in reorderbuffer.c Message-ID: <20190205211118.GA30474@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <874l9p8hyw.fsf@ars-thinkpad> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-31, Arseny Sher wrote: > My colleague Alexander Lakhin has noticed an assertion failure in > reorderbuffer.c:1330. Here is a simple snippet reproducing it: > > SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding'); > > create table t(k int); > begin; > savepoint a; > alter table t alter column k type text; > rollback to savepoint a; > alter table t alter column k type bigint; > commit; > > SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); Hmm, the new test introduced by your patch fails in early branches (at least 9.4): the transaction is decoded like this: ! data ! ----------------------------------------------------- BEGIN table public.tr_sub_ddl: INSERT: data[integer]:42 + table public.pg_temp_16445: INSERT: data[bigint]:42 table public.tr_sub_ddl: INSERT: data[bigint]:43 COMMIT ! (5 rows) note the additional pg_temp_XYZ row in the middle. This is caused by the rewrite in ALTER TABLE. Peter E fixed that in Pg11 in commit 325f2ec55; I don't think there's much to do in the backbranches other than hide the pesky record to avoid it breaking the test. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services