Re: Segfault logical replication PG 10.4

From: Minh-Quan Tran <account(at)itscaro(dot)me>
To: Minh-Quan Tran <account(at)itscaro(dot)me>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Segfault logical replication PG 10.4
Date: 2018-07-28 09:19:56
Message-ID: CAKH=C-8xAWh_-amB8Rtm-17B+SYa3_x441Noh+OeLgJnOz4mrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Here is the steps to reproduce this problem.

Thank you.

Pastebin : https://pastebin.com/Wc80YegY

--

CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS ltree;
CREATE EXTENSION IF NOT EXISTS intarray;
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS unaccent;
CREATE EXTENSION IF NOT EXISTS pgcrypto;

CREATE SCHEMA IF NOT EXISTS itscaro;

CREATE DOMAIN public.tag3level AS ltree
constraint tag3level_check CHECK (public.nlevel(VALUE) = 3);

CREATE OR REPLACE FUNCTION public.is_valid_array_tag3level(ltree[])
RETURNS boolean AS
$BODY$

SELECT NOT EXISTS (
SELECT 1
FROM unnest ($1) tag
WHERE tag operator(public.<>) tag::public.tag3level
)

$BODY$
LANGUAGE sql IMMUTABLE STRICT;

CREATE DOMAIN tag3level_array AS ltree[] CHECK
((public.is_valid_array_tag3level(VALUE)));

CREATE TABLE IF NOT EXISTS itscaro.test
(
id int,
tag public.tag3level_array DEFAULT '{}'
);

insert into itscaro.test values (2, '{{test1.test2.test3}');
-- NOTE: initial data copy is done correctly

-- Pub/Sub

-- Master
CREATE PUBLICATION itscaro_test
FOR TABLE itscaro.test;

-- Slave
-- On slave as this moment we have all domains, functions, extensions and
testing table
CREATE SUBSCRIPTION itscaro_test
CONNECTION 'postgresql://postgres@<FILL IN MASTER IP>/postgres'
PUBLICATION itscaro_test;

-- Inserting new data after subscription is registered

insert into itscaro.test values (2, '{tefghjfgqst.qdqsdsq.qdqsdgfjhfghqs}'),
(3, '{teqghjghjgfst.qdqsdsq.qdqsdqssqdqsdqsd}'),
(4, '{tjgfjhghjgfjheqst.qdqqsdqsdjghjdsdsq.qdqsdqsqsdqsdqs}'),
(5, '{teqsqsdqsdqsdqsdqs.qdqsdsq.qdqsqsddazfdgfdhgfjhgfjhgdqs}'),
(6, '{teqdqqsdqsdqsdqsdqsst.qdqsdsq.qdqsdqs}'),
(7, '{teqst.qdqsdsq.qdqsdqsdqsdqsdqsdqsqs}'),
(8, '{teqsdqsdqssazdazdqdqsdqsdsqdqsdqst.qdqsdsq.qdqsdsdsqdqsdqsqs}'),
(9, '{teqqsdqsdqsdqsdqsdqsdqsdqsdqsst.qdqsdsq.qdqsdqsdqsdqsdqsqs}');

-- After executing the insert batch on master, failure occurs on slave
--
-- 2018-07-28 10:46:05.230 CEST [3132] LOG: database system is ready to
accept connections
-- 2018-07-28 10:46:05.240 CEST [3705] LOG: logical replication apply
worker for subscription "itscaro_test" has started
-- 2018-07-28 10:46:05.269 CEST [3132] LOG: worker process: logical
replication worker for subscription 275990 (PID 3705) was terminated by
signal 11: Segmentation fault
-- 2018-07-28 10:46:05.269 CEST [3132] LOG: terminating any other active
server processes
-- 2018-07-28 10:46:05.274 CEST [3702] WARNING: terminating connection
because of crash of another server process

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Quan Tran 2018-07-28 09:31:05 Re: Segfault logical replication PG 10.4
Previous Message Amit Kapila 2018-07-28 06:14:11 Re: Explain buffers wrong counter with parallel plans