Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgdNA-0006fQ-4p for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2020 00:04:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgdN9-0004ls-2F for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2020 00:04:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgdLM-00014b-T2 for pgsql-hackers@lists.postgresql.org; Thu, 04 Jun 2020 00:02:48 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jgdLJ-00064y-Ah for pgsql-hackers@postgresql.org; Thu, 04 Jun 2020 00:02:48 +0000 Received: by mail-qt1-x842.google.com with SMTP id j32so3744560qte.10 for ; Wed, 03 Jun 2020 17:02:45 -0700 (PDT) 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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=07jHhdW7RbWxpGYNEQJmkCN1r2HtWDngpxrqM4fuR7A=; b=mIz9n1n3sALGivt/mwyJ3KlwDd1GydhVAVyygDVHygS/Mx1bf6hGGBDbP3CnyxEv7x VsR36+a2N642TKYccwf7Zn/NJQjuRCDBGaDN7zpCan036tY1hSCMBwYC9AilbFNxSH3Z 1x97+VDXkobdS8w+o2rXI99P0lRjNS5DiQo0WNejg0flDmLbtI0NiSJCAcQbIfgYorQN oTPx8xiIpS/6wXMpPEETxGqb7dbFENQZXoZ3ZyUvT3gm+4Pu9+TgwnEOudAKpj3oyY+P xhD4zl6Ylsairf3S1KgLvhbjx5KtCJn/rFJtw5sNL372ANVjmZerJ99O1NpR2ExZGHxA prOw== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=07jHhdW7RbWxpGYNEQJmkCN1r2HtWDngpxrqM4fuR7A=; b=NZpfhcIQ/gWIO9JrvpsI0TmV+SQdIaqDtaaLT+LEUp2+6z1UrNpNccT1sWKOfnsbIH EG/epdliifuEires9XHvXEE/Pth4WeeJ10C9aBrn/wKuyjS0rVc+OzelubDtZcB+hXal ffLfQKxKf0AqjTY+icldxPnbEVYy3PKu54dPbWbsa+gkiKQcWfxhXVhWKLGvbI228bnh pJOWSl6nYnsq/WNjiFqwa4LpTGO7jUe8zyfav9m9eITN8ONqULQMUjI8FkIa0Bhqf1nd V7nZf9PDCZ9J7gDlMWEvQLh3aUuWtkgJxIoGuA9/PMGAAztTiZmfzx8tc8Jb7tjjAnLY YNtw== X-Gm-Message-State: AOAM533NmuZnBg7iWPr5JKJ+x4sF77dykZGq4aUCIfu5LteeH2hfYEPl W3EIIWRbtakE0xZWObNMPYGeKg== X-Google-Smtp-Source: ABdhPJxy9fmpXECDqpY4wONoOjbikECHm6O5QrGyMNs7CrQEOrdgqIMgOzm1rH+F+rtJWYOkR6b3Lg== X-Received: by 2002:ac8:17a1:: with SMTP id o30mr2061559qtj.140.1591228963773; Wed, 03 Jun 2020 17:02:43 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id c58sm3515616qtd.27.2020.06.03.17.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 17:02:42 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 838313008F8; Wed, 3 Jun 2020 17:44:48 -0400 (-04) Date: Wed, 3 Jun 2020 17:44:48 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Masahiko Sawada , Kyotaro Horiguchi , sitnikov.vladimir@gmail.com, PostgreSQL-development Subject: Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762 Message-ID: <20200603214448.GA901@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200602042456.GA3594@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jun-02, Michael Paquier wrote: > I can note as well that StartLogicalReplication() moves in this sense > by setting xlogreader to be the one from logical_decoding_ctx once the > decoding context has been created. > > This results in the attached. The extra test from upthread to check > that logical decoding is not allowed in a non-database WAL sender is a > good idea, so I have kept it. I don't particularly disagree with your proposed patch -- in fact, it seems to make things cleaner. It is a little wasteful, but I don't really mind that. It's just some memory, and it's not a significant amount. That said, I would *also* apply Kyotaro's proposed patch to prohibit a physical standby running with a logical slot, if only because that reduces the number of combinations that we need to test and keep our collective heads straight about. Just reject the weird case and have one type of slot for each type of replication. I didn't even think this was at all possible. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services