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 1iYCuf-0004q2-85 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2019 17:40:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iYCud-00061X-JX for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2019 17:40:07 +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 1iYCud-00061Q-BC for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2019 17:40:07 +0000 Received: from vps.xff.cz ([195.181.215.36]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iYCua-0000PA-OG for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2019 17:40:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1574444404; bh=XNtbcf+26cYt/9G4k4VXF21eZVRVCceWLvHm8TOMx/4=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=TqCHZk6Hf1UpZlF9imGukHnS0ZBi+Mcof3ghBJF3rfn+U7AgPKfNAOTNM2H1PBZZp +qWHLZxQGB6m+HBfj6xw7MEwGxdmFtf6VjmhzHHWV6brfk6kTrZ3o8KhL5r68vgQSf lWK8dqFJnGlCM1FvOYv+IDrnd/cEzIGYB8XpiadQ= Date: Fri, 22 Nov 2019 18:40:03 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Tomas Vondra Cc: Tom Lane , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker Message-ID: <20191122174003.xyaixb6iwbvtyplp@core.my.home> References: <20191121161502.xfiy65i3cm6adscr@core.my.home> <20191121165752.dffge6bh756xlfdg@development> <20191121173555.midj6vp4dmiiqs24@core.my.home> <20191121185844.6qsqhwzzuhu3fpsg@core.my.home> <20191121214115.3tgefmvkmrzaim74@development> <20191121220854.ebdzjtloel56sfwu@development> <20191122003626.ydgwvjfx363blgip@core.my.home> <16189.1574383534@sss.pgh.pa.us> <20191122005401.bkdpmtqwuu6mvnyg@core.my.home> <20191122161248.qnzeoh6t7fvg5wl3@development> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191122161248.qnzeoh6t7fvg5wl3@development> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Nov 22, 2019 at 05:12:48PM +0100, Tomas Vondra wrote: > On Fri, Nov 22, 2019 at 01:54:01AM +0100, Ondřej Jirman wrote: > > On Thu, Nov 21, 2019 at 07:45:34PM -0500, Tom Lane wrote: > > > =?utf-8?Q?Ond=C5=99ej?= Jirman writes: > > > > On Thu, Nov 21, 2019 at 11:08:54PM +0100, Tomas Vondra wrote: > > > >> 1) Print newtup.values and newtup.changed matches, so that we can check > > > >> it contains the tuple I shared before? There should be 8 elements in > > > >> each, with 'values' being values formatted as text, and 'changed' being > > > >> flags which values were updated. > > > > > > > newtup.changed > > > > > > > {true, true, false, true, true, true, true, true, false } > > > > > > So column 3 is not getting replaced. That seems to jibe with my > > > theory that slot_modify_cstrings is failing to handle that case > > > correctly. Can you try applying the patch I posted and see if > > > it fixes the issue for you? > > > > With the patch the replication resumes, without a crash. > > > > confirmed_flush_lsn is now same for all my replication slots. > > > > thank you and regards, > > Can you show us the attribute list as defined in the system, including > e.g. dropped columns? That is, something like > > SELECT attnum, attname, atttypid FROM pg_attribute > WHERE attrelid = 'public.videos'::regclass; > > both from the published and subscriber. I don't think there were any dropped columns and replica was always created by schema copy + subscribe with copy_data=true. Anyway, the original database is gone now (on both ends), so I can't get any more info. regards, o. > regards > > -- > Tomas Vondra http://www.2ndQuadrant.com > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services