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 1hE6vO-00080S-HM for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2019 06:41:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hE6vN-0004mn-9M for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2019 06:41:33 +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 1hE6vM-0004mg-Hs for pgsql-hackers@lists.postgresql.org; Wed, 10 Apr 2019 06:41:32 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hE6vJ-0001hG-4X for pgsql-hackers@postgresql.org; Wed, 10 Apr 2019 06:41:30 +0000 Received: by mail-pl1-x644.google.com with SMTP id b3so779879plr.7 for ; Tue, 09 Apr 2019 23:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xvfEXboTQJEvXSjNMBKS+C91vJoPaWaeL1QEzT6uUbY=; b=nS4XwK2lbxOBXS1F054GW9yWTIhmTLpkmxHq1Ha3lAlVu6LLGIvegVL4b+VbB6pefJ su+uhpYoIe3mk3nhFnr7a+lmMl3Qc+SQYeyfoeyRxgPoZWAwHkX8QW1eXSnZc36YZXCl sh12prWWL2TJWJuhkaweARwiErp+1iZisYSmKKPMiFPHavWFcerRg9m3OhoMWNOn22Ea HZq0WSJ4KSgGxEUzkKPlxHqu2Sy1Kwv6TFUtX4p6DHZwysorzAjDuhvT82T48BU7G5Of IRrhjol11E3kkVqKdkHg/9lGwrHpx7/gNAnHGRhQs+lbnAr7rbWuQSYlyYcoRDlrcT5M vpZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xvfEXboTQJEvXSjNMBKS+C91vJoPaWaeL1QEzT6uUbY=; b=AQ4ANS+vP1NeVwu2IG2lcbdHduA7RJSbQVqOTu28nM9MuILbd5L/YOMjgp0Ea6hwFY SHBgS8tjI2ck34Fsn2xEAiPOyTlvaEfTXH8EHjAHbt17t2DeRmGVr6XLp1NzpZV5nCYA 62Nr2Mv+662Z5OE/aFwnM59Q8jvmHbm+M2lHGeLbavtGkrcG4KQQ4IhsY4rHeT+RxE5B yO3ssbTsjXmGidhLJZOu5kBhOihz69fpSP4iZMeksCjdoJdxIfXA9ndsUevOFruos/YB cctygY00fzWsEaQK/UIzFiN8bFoc/WY/Gb48+q3Lc+ku/5agsRULpDfqbUavdlfT0w8R Uwbg== X-Gm-Message-State: APjAAAVze2UMBQ7tU5wAfP8ZM/KvpXTwYYrmsBVoAC3BbvSz82Ifmq5M KBzCqL2zM8Gh2xUHmfCWl198lWWV2eYoiWFHaNyVwyPolS6GRaelMusFz/HDaZFJ3mm/CZkScdE 9ZEt/ILc8um1vw3Aw4YIKb6sPYXSwPi5NcXpB5ka3wI/kv0Huwncj//WiBlw2ld+wt98KgHc0RM fYJUZVZd2A2g== X-Google-Smtp-Source: APXvYqzLFEdyaic6GkTOB/+1FzY9742OQeWr/MuEzc0k0dWIYKNMIhVlhHx0tL3Kpg8oI03o43zSEQ== X-Received: by 2002:a17:902:b686:: with SMTP id c6mr42168260pls.14.1554878487741; Tue, 09 Apr 2019 23:41:27 -0700 (PDT) Received: from localhost.localdomain ([114.143.109.178]) by smtp.gmail.com with ESMTPSA id e126sm81377333pfh.35.2019.04.09.23.41.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 23:41:26 -0700 (PDT) Subject: Re: Minimal logical decoding on standbys From: tushar To: Andres Freund Cc: Petr Jelinek , Robert Haas , Craig Ringer , Petr Jelinek , pgsql-hackers@postgresql.org References: <20181212204154.nsxf3gzqv3gesl32@alap3.anarazel.de> <7e905539-7fdc-6b29-5a56-ba48d180fef8@2ndquadrant.com> <20190301174628.rjzoi7arvci5ldcm@alap3.anarazel.de> <20190304172739.hdkwmtngwx5444un@alap3.anarazel.de> <9fce660d-47fc-4294-3084-3769e543da8a@enterprisedb.com> <53656d0c-1868-86e8-54a6-216ce74b353a@enterprisedb.com> Message-ID: <8af22fc0-d08c-f3fa-e7ec-dfb153b3d7b4@enterprisedb.com> Date: Wed, 10 Apr 2019 12:11:21 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <53656d0c-1868-86e8-54a6-216ce74b353a@enterprisedb.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/13/2019 08:40 PM, tushar wrote: > Hi , > > I am getting a server crash on standby while executing > pg_logical_slot_get_changes function   , please refer this scenario > > Master cluster( ./initdb -D master) > set wal_level='hot_standby in master/postgresql.conf file > start the server , connect to  psql terminal and create a physical > replication slot ( SELECT * from > pg_create_physical_replication_slot('p1');) > > perform pg_basebackup using --slot 'p1'  (./pg_basebackup -D slave/ -R > --slot p1 -v)) > set wal_level='logical' , hot_standby_feedback=on, > primary_slot_name='p1' in slave/postgresql.conf file > start the server , connect to psql terminal and create a logical > replication slot (  SELECT * from > pg_create_logical_replication_slot('t','test_decoding');) > > run pgbench ( ./pgbench -i -s 10 postgres) on master and select > pg_logical_slot_get_changes on Slave database > > postgres=# select * from pg_logical_slot_get_changes('t',null,null); > 2019-03-13 20:34:50.274 IST [26817] LOG:  starting logical decoding > for slot "t" > 2019-03-13 20:34:50.274 IST [26817] DETAIL:  Streaming transactions > committing after 0/6C000060, reading WAL from 0/6C000028. > 2019-03-13 20:34:50.274 IST [26817] STATEMENT:  select * from > pg_logical_slot_get_changes('t',null,null); > 2019-03-13 20:34:50.275 IST [26817] LOG:  logical decoding found > consistent point at 0/6C000028 > 2019-03-13 20:34:50.275 IST [26817] DETAIL:  There are no running > transactions. > 2019-03-13 20:34:50.275 IST [26817] STATEMENT:  select * from > pg_logical_slot_get_changes('t',null,null); > TRAP: FailedAssertion("!(data == tupledata + tuplelen)", File: > "decode.c", Line: 977) > server closed the connection unexpectedly >     This probably means the server terminated abnormally >     before or while processing the request. > The connection to the server was lost. Attempting reset: 2019-03-13 > 20:34:50.276 IST [26809] LOG:  server process (PID 26817) was > terminated by signal 6: Aborted > Andres - Do you think - this is an issue which needs to  be fixed ? -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company