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 1hEFn9-0002KX-4e for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2019 16:09:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hEFn7-00022u-7w for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2019 16:09:37 +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 1hEFn6-000223-R8 for pgsql-hackers@lists.postgresql.org; Wed, 10 Apr 2019 16:09:36 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEFn0-0006zc-6Z for pgsql-hackers@postgresql.org; Wed, 10 Apr 2019 16:09:35 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 6DC4A21B83; Wed, 10 Apr 2019 12:09:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 10 Apr 2019 12:09:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=r NpT4PD5AcVikKUFSFq8aCk342J9Ze9R1llJupn8Lps=; b=u+yWZSbPf/bAMDXjZ +PgDbswwLPBmIA1DgafdFI/peza9BqYhpppDTzUOz/QoGawgVpLYcfQDPZJRsJsn 8ATYVgziEyOiNbRK5bwNNaZ7kO7ZvwdkaezaDVx3Gsyqyi4WjCvvJr/0LmY+7Cym MSebtlu8iMLW08IDsrKX8frFHiY6h8IcxqytW+HpPVZO8rpr4o6PGyXAZLiVicnu sOSul67u8cX36k2t1+snCI88n/IO4uArdJKjZdTt8qE0izH22a4cd0xrGEt5PY2G WtTcpW7JquwyAB3cZulzrSnw+CpBlMnUnE4YK1U8iFYrgd7fGIKGSfhwB5TLCklG ix78A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=rNpT4PD5AcVikKUFSFq8aCk342J9Ze9R1llJupn8L ps=; b=wssitsbMws1bEIqjIPA7e8cAOyvV+ZJ2zskDjQKEwTyeOpAvH7j+PyLG2 q/gO7DHEGyqcwycTFhRPSWa3jlYjkmbsUSoB3Ai0BXIJol5Hkbwf5cD6VWJtr4Pc rS8xcB2ilTamOrZI32jhYXpeA6RIHXTFJQzcAJVtrncbgX993aSCkX2rU1TC0suz jIfw6X0cJm7aKPYIHWUN7XgwNrGBUdHxnDtak0CqvSmoT+fcbOn8MWnD8GVZW/pE Ak/tPwbC82tUa8UtPtdbgcsV+2DIa2p3xyBiwFSHdCXvyl7u/p6cFIuqz7+iNSgu YK8u9QJJigB5a/Yjq8akElCq7N6rg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudejgdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkpheple ekrddvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgv shesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F0B6E409D; Wed, 10 Apr 2019 12:09:28 -0400 (EDT) Date: Wed, 10 Apr 2019 09:09:25 -0700 From: Andres Freund To: tushar Cc: Petr Jelinek , Robert Haas , Craig Ringer , Petr Jelinek , pgsql-hackers@postgresql.org Subject: Re: Minimal logical decoding on standbys Message-ID: <20190410160925.c4sat4ex67blinhy@alap3.anarazel.de> 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> <8af22fc0-d08c-f3fa-e7ec-dfb153b3d7b4@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8af22fc0-d08c-f3fa-e7ec-dfb153b3d7b4@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-10 12:11:21 +0530, tushar wrote: > > 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 ? Yes, it definitely needs to be fixed. I just haven't had sufficient time to look into it. Have you reproduced this with Amit's latest version? Amit, have you spent any time looking into it? I know that you're not that deeply steeped into the internals of logical decoding, but perhaps there's something obvious going on. Greetings, Andres Freund