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 1iYBYI-0002Lb-Lm for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2019 16:12:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iYBYH-0007Vb-55 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2019 16:12:57 +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 1iYBYG-0007VU-Mv for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2019 16:12:56 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iYBYD-0007sj-HR for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2019 16:12:55 +0000 Received: by mail-wm1-x342.google.com with SMTP id z19so8248318wmk.3 for ; Fri, 22 Nov 2019 08:12: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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=BJopJgcS/AEJvJgxF2ccjxCUuD4skcDgDWdY+k4MbnY=; b=LQrAYSt1Ao7XDqvteVRMRlXXkSSL+wkpbBNWB5X8IvBIn3EY89paTf7bZTwL79eoyq Kqgqxo/ZP7B3+If0N/UdbeeiEwXGduUEyxiNi7TdoaL6Oo1jJRfbvBtzyqmFxfgoLwVp f5ee2/xunGw5kSe0/RlZUsX9gbUP2PYT8mqisjsj6E3MFCsmL706quWOUFV9SnyN60hr p7SiPWuqaMVQJ0rVFczuKlkdqiDjnd+VfLezxPb+ziv8t0UGPdD/nYzT2btrZwyeWs+E pfL4rSUAei8lBphKxh5o12V5ZbcLSaAqJfVmU3CVOkT/uJhCU+PT6+f38ndqEOWzxVHF FSDA== 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=BJopJgcS/AEJvJgxF2ccjxCUuD4skcDgDWdY+k4MbnY=; b=GhCmkh2xGDIuRMcNObUo9/9q//4KT8uZsz4RhA5/w+QI0/vPmcLrc1f+n1pwRKgWRr RJsMOvzDmUUfdVmPXXxfY87Y3RxKTmz2fyV/g37cIxl4xv60wF3TMVia6HpOAr5JmvcO gH1kwwKC4EXBwFQGNc/mF7DFjLcasFxoMFw0qGjQjxrKGEVTcGwtPiAxiQRMWtlQo6Ut pI2uEFCyp5kV1hnY8zrmXFg107kS+BmbRakAcGy26ntTGuRC6a5XUjwvis1h1Fof1/s+ 68GFsiFsBEeDFRTa0ZOaeA+lL3wChqBXSfyUWSqccUvQU0R+L5BDy7qf6IopAJhdgPuP o2VQ== X-Gm-Message-State: APjAAAUZzvkOhBjlrC6ED+Dt23579nvDWofkuEuoagENbh/tFMAXorQT bSoxymN9xahpoz4XDPv7LPI3XA== X-Google-Smtp-Source: APXvYqz9UVY9gBQ/N+Bz3U9jdIEFzsqjLaTePfqDk8hIbCgIAgRlZptzZHmVVgOTjdhGh6EsRYN9YQ== X-Received: by 2002:a7b:c776:: with SMTP id x22mr16629036wmk.144.1574439172042; Fri, 22 Nov 2019 08:12:52 -0800 (PST) Received: from localhost ([217.8.174.100]) by smtp.gmail.com with ESMTPSA id k4sm4233230wmk.26.2019.11.22.08.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 08:12:50 -0800 (PST) Date: Fri, 22 Nov 2019 17:12:48 +0100 From: Tomas Vondra To: =?utf-8?Q?Ond=C5=99ej?= Jirman Cc: Tom Lane , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker Message-ID: <20191122161248.qnzeoh6t7fvg5wl3@development> References: <20191121155707.pqkgjphh65o5fapz@core.my.home> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191122005401.bkdpmtqwuu6mvnyg@core.my.home> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services