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 1iXpmM-0008ST-0A for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Nov 2019 16:58:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXpmJ-0001Nz-98 for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Nov 2019 16:57:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXpmI-0001Ng-Ty for pgsql-bugs@lists.postgresql.org; Thu, 21 Nov 2019 16:57:59 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iXpmG-0005PY-0V for pgsql-bugs@lists.postgresql.org; Thu, 21 Nov 2019 16:57:57 +0000 Received: by mail-wm1-x334.google.com with SMTP id 8so4581763wmo.0 for ; Thu, 21 Nov 2019 08:57:55 -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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=zV7hYhBQlAp5GBW6S6DcBu7FMryFL75keHhiyv9Ao2g=; b=emw1cBBkfbqdd434V7HsOZ9+TuhXprjXd1jZiO5x1L/ksRpigeozRvbMMNpNLqqZ/8 DUuhiykYQvUssY8NBlOGejJrFGYw7jiMqB35EcW6jkUVThftOwQmFS6qlDrdekQa9XKj 4ulYBg0Xlnra+M9uhipZe0LF+vLE87BiMaJ09mNzxsshEvBGkSw5BoBlEQDGlnko7J6B 0HEWzFtFOxStSdObZw/paxp2S5ieegrZWBbXtAOaXx1g1FYd3kqyuN4GxEJAeK8MEk9x WotVEn/xPVfXUc6mJZEMcLKWHBYIhubsYxRRhM4Kd8hHtK9nnO4LM956zu2LqUaqAiJa 1wJA== 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:content-transfer-encoding :in-reply-to; bh=zV7hYhBQlAp5GBW6S6DcBu7FMryFL75keHhiyv9Ao2g=; b=lOVGT0v9b4C6GSNJgjBLrLuGNWJeNV7kufPUWUPtCCdOA712CiDZY0eKYR2sLdkc+o CN2N9mN6mYY4MQ7/Wt/RiH598MI3qw4gCmIR7l/VhXwutcDGEp0J3beXBQivUrehbwDG rOhFY0yo5YN3uqb/wlhTXzDPPkvQ2+xzi5WRNPixNonNA7v3aH04+8+7O90dCfW+auFy UdOrJuiYGaoKkjBiQRGc6c/BjfnWtW97TJs/yLPNdRFApFf++a2TymcEsBHEcCvY4jhI tYJYGWBQiNPtsu3jdMSaqOyEYQTApzL+Cys/PZNPZIPOqM7BDDOQbFx6OTwDcpgjdKoT /+lQ== X-Gm-Message-State: APjAAAUBwZ9TPiF8uMGet7cTXzKt1Bq7asLtCCJiT+kPyDMzQV50nNX0 hPM9FPdBTvjgGiSrFvUngyHNIwKg4/M= X-Google-Smtp-Source: APXvYqxVHI5kR1j2Q2kdJZ6RiDDQlW6ny7ljNtuT7B9S+hl/ivijGmqvLwJKG9+ujPXY2DdpNsAY3Q== X-Received: by 2002:a1c:6144:: with SMTP id v65mr11513606wmb.53.1574355474194; Thu, 21 Nov 2019 08:57:54 -0800 (PST) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id v9sm3723811wrs.95.2019.11.21.08.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 08:57:53 -0800 (PST) Date: Thu, 21 Nov 2019 17:57:52 +0100 From: Tomas Vondra To: =?utf-8?Q?Ond=C5=99ej?= Jirman Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker Message-ID: <20191121165752.dffge6bh756xlfdg@development> References: <20191121103940.gpadc7xmssl63sad@development> <20191121115326.arierrbeok6we5sv@core.my.home> <20191121125913.4dhhwpbw67vqx37o@core.my.home> <20191121133237.vgxoilemblaqmstu@development> <20191121135523.aybyo7o6yzxxungd@core.my.home> <20191121143503.nkdwgjwb7xjopeuq@development> <20191121150716.szxqukxrtpjpckm3@core.my.home> <20191121152732.hu6y4wzw7nkxpsvk@development> <20191121155707.pqkgjphh65o5fapz@core.my.home> <20191121161502.xfiy65i3cm6adscr@core.my.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191121161502.xfiy65i3cm6adscr@core.my.home> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Nov 21, 2019 at 05:15:02PM +0100, Ondřej Jirman wrote: >On Thu, Nov 21, 2019 at 04:57:07PM +0100, Ondřej Jirman wrote: >> >> Maybe it has something to do with my upgrade method. I >> dumped/restored the replica with pg_dumpall, and then just proceded >> to enable subscription and refresh publication with (copy_data=false) >> for all my subscriptions. > >OTOH, it may not. There are 2 more databases replicated the same way >from the same database cluster, and they don't crash the replica >server, and continue replicating. The one of the other databases also >has bytea columns in some of the tables. > >It really just seems related to the machine restart (a regular one) >that I did on the primary, minutes later replica crashed, and kept >crashing ever since whenever connecting to the primary for the hometv >database. > Hmmm. A restart of the primary certainly should not cause any such damage, that'd be a bug too. And it'd be a bit strange that it correctly sends the data and it crashes the replica. How exactly did you restart the primary? What mode - smart/fast/immediate? >So maybe something's wrong with the replica database (maybe because the >connection got killed by the walsender at unfortunate time), rather >than the original database, because I can replicate the original DB >afresh into a new copy just fine and other databases continue >replicating just fine if I disable the crashing subscription. > Possibly, but what would be the damaged bit? The only thing I can think of is the replication slot info (i.e. snapshot), and I know there were some timing issues in the serialization. How far is the change from the restart point of the slot (visible in pg_replication_slots)? If there are many changes since then, that'd mean the corrupted snapshot is unlikely. There's a lot of moving parts in this - you're replicating between major versions, and from ARM to x86. All of that should work, of course, but maybe there's a bug somewhere. So it might take time to investigate and fix. Thanks for you patience ;-) regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services