Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ejb1F-00052t-8d for pgsql-general@arkaria.postgresql.org; Thu, 08 Feb 2018 01:28:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejb1D-0003g9-Qe for pgsql-general@arkaria.postgresql.org; Thu, 08 Feb 2018 01:28:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ejb1D-0003fz-CZ for pgsql-general@lists.postgresql.org; Thu, 08 Feb 2018 01:28:55 +0000 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ejb19-0000cf-BR for pgsql-general@lists.postgresql.org; Thu, 08 Feb 2018 01:28:53 +0000 Received: by mail-wr0-x235.google.com with SMTP id h9so3049755wre.12 for ; Wed, 07 Feb 2018 17:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OilTVZhLU6ibzVTM0EChCBIX6vxHQMY6r7EJNqhaR/c=; b=ba5vJ8hyHK730MV4xwZhme71b4FIXAEBaYWn8MGC1i8ZBaB+mAb79KE2tY6BROVaab f4Uc+eB1PxzR7vWL0oLlGBWXjRto2j86KdxN2pZt91+MFVUwI+b5cUHAsT2k4A4XPKxP 0rnqIGV6BnoIIDccHANq/22Rgh5POBSMxc7YlnBfUDhzMrd60R7WFPdmKg7F7QJy19xY OpHfA1VxL4FlQSS5uH6nzewO41RIi1IS2w1fRbdlMLSQkqOBwqVhsZZjgbu9zJvxxbiT AMYrDatW5hRZyn81r6DG/ebUAP3oupcHFpQAn6ox2DdhPIbm8cgKPNViTynA5c0V3663 cNVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OilTVZhLU6ibzVTM0EChCBIX6vxHQMY6r7EJNqhaR/c=; b=QgV2BTFQfhHx3ATmC8DpUBG+tvfCJOW46gM25LOwtdZYi2QEZJWuiRDLVpJyJ+VN/g sdAto3TGgiUcWJfQKhkflEX81/1PZSYBvswEyqXMybwcOysO284Da5DzGDhFxjRT7WjK vkXQv4QXnhQh8MpkFefuCKwYsZhMJBzAggkeH5J60enq1rYBbobnv81eK92P9XkXz1eB sjpIykJYsyQnVrV85tE8ZwT99LgAijGvR9wPsqRUELsHtu9mkmH0XvXJ4wjsd9SzniAu /N+TEfv8deyKygLgjMNtjZHgERjerGJYGV5u/uh0yLR0JHmEBccd1zcHHq8wFujb5L/T GrBQ== X-Gm-Message-State: APf1xPDj293zNUfhzUbHD5jqmOVY783lh3BAIoGu6zeDfXEjVoLVavxQ 602hZalpt37F/qrKW1TY+c0nIsfsXAhLG6WX1gDJjdX5uS7PMMRMdpVPgYJTlt2lfXZAcwJnppu H4MM6qc2Cu1AJO5veMy19VEeP+lTYtrgDyy5lo4dOC4XUKuSb43mVjHYA/9q6LsR1T2b+OUrr54 uhqMLpr5uQlCbYEwLx4oI= X-Google-Smtp-Source: AH8x227LqujJnqDMrMC4N0FnJlNtDuBUlgekMXyweNAINAun4ooolRWdt+Y9qECL5Bo18HaU8ymESw== X-Received: by 10.223.182.169 with SMTP id j41mr69017wre.203.1518053329463; Wed, 07 Feb 2018 17:28:49 -0800 (PST) Received: from [10.137.2.17] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id f22sm2890706wmi.24.2018.02.07.17.28.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 17:28:48 -0800 (PST) Subject: Re: Critical errors during logical decoding To: Colin Morelli Cc: pgsql-general@lists.postgresql.org References: From: Tomas Vondra Message-ID: <2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com> Date: Thu, 8 Feb 2018 02:28:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 02/07/2018 10:22 PM, Colin Morelli wrote: > Hey Tomas, > > We're using v1.1.0 of pglogical. I can't honestly say what could > reproduce this issue as I'm not entirely sure and haven't tested it yet. > Well, consider updating - there's 1.1.2 in that exact branch, and there's also 2.1.1 now. I don't recall if there were bugs with such symptoms, though. > I had thought it was caused when a toasted row is deleted before the > pglogical_output plugin processes the event (so it fails when going to > de-toast the row), but I would imagine that postgres internally should > prevent deleting data that would be needed by a replication stream. I > must admit I'm not well versed in this area, though. My understanding is > wal2json doesn't detoast the data at all, and thus doesn't have an issue > (for our case, we really just need the json data with an identifier > telling us that the row changed, we're not doing full logical replication). > That seems really unlikely, for a couple of reasons. 1) As you've correctly guessed, toasted values are protected by the same MVCC mechanism as regular tables, so rows should not disappear when transactions might still need them (including replication). 2) The detoasting happens in reorderbuffer, which is shared both by pglogical and wal2json. So both should have been affected. 3) You've also mentioned missing files in base/ which suggests there's something far more serious going on. Not sure what, though. I suggest you do one or both of these things: a) update to newer pglogical version and see if it fixes the issue b) try preparing a self-contained reproducer c) share a more complete version of the server logs (hard to say what's the issue from just a few lines) regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services