Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1foHG8-00055a-AG for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Aug 2018 23:55:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1foHG6-0001uN-89 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Aug 2018 23:55:54 +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.89) (envelope-from ) id 1foHG5-0001uE-Tb for pgsql-hackers@lists.postgresql.org; Fri, 10 Aug 2018 23:55:54 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1foHG2-0005wO-F2 for pgsql-hackers@postgresql.org; Fri, 10 Aug 2018 23:55:52 +0000 Received: by mail-wm0-x241.google.com with SMTP id c14-v6so3442242wmb.4 for ; Fri, 10 Aug 2018 16:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1p1smpDnwXTxRy60ShvthpI1158lV/HrgVX/bydr20c=; b=m0Lx5OkJchKs5EtOhzgEfhcHh6lK300EYQl/B0FAFQonDUMLtCpEn3FCtL9Or9/Vgq PDmlWSW7ASWfXIbyxqfsJZcA+kmx34PP86PdxUBofKrOnVq8s/c4MOBvUhAoK0nuBLJU fGfE9Q2kWucZIJQjChfIyvtdb8bXnG9wpfJ16Hnkxbgl/SQ7jzEd84I0zVhqvgUKAiMk Q8p2sd4xU79cA1TE6+vIZTvAT0N4rUlfWpIlyEMt+41zTbYavtbzEo9kImA6ODVfQmIy 2dl9XUx6sUhPsxRhUs5GFhxcB1lsfp3fDoDWosa4m5Sws96kMAsQWrFO4IqvIVS3q0GK 89zQ== 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-language :content-transfer-encoding; bh=1p1smpDnwXTxRy60ShvthpI1158lV/HrgVX/bydr20c=; b=dcdn4SSzLqnpZiNtJQsc9FwxRWuILZU1Ojt9H+cKaoZl1EqrARCe6L+DLJzUEkdBKn KDu7I0LMtQkqvyN0N+kZudJjD0ydXr38xj5t+rkP/Nty7qkGmeTwXMzfQeXMyvxNe3W8 KcGYDj0uIKDvIjuqNR1KBf24mCgtc55S9DZuS4uzawlHJSJv08WTA1tF7icTIZS0zZdH Fi5Q4Oiy71Li+C8QB82JYe+4pXamWYhqDNs00JFvaANCf+ZwHO6prCTxBeKz5gcu5Nvq qXmODWlDjgsVUSZE2U7Xc92kpJCLcbH0vaPokJpRnhMoYBfgkfsXWqK3uLROUO2S2iW/ 04Kg== X-Gm-Message-State: AOUpUlEeNmMhg+olgm/sqyCzm5uExKlWAzKolHLz+KxYhtVcRL4xLiWK ssPQjX581tARN5NvQUUoT4G7GWKlcwpUor299o3oq2G9rklc4PPzHhegJgSaIeX+Q+8GtORQxkc TwT7+bKiEmzwG9R8/Az4BPT4Vo/lBlACs+mnEt5QOxjy9xPaFhiCMZ/rYeWjDUjF3/96pgQp9Nf FkeIKYmNz8kSI= X-Google-Smtp-Source: AA+uWPwBP7tTLGJ/Vv5f6BPmgHycHBQ/EBE8X4ub7HihlQM+Di+dbXpivIijQOejmTAJjm1cppFitg== X-Received: by 2002:a1c:7c13:: with SMTP id x19-v6mr2817442wmc.27.1533945347785; Fri, 10 Aug 2018 16:55:47 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id f132-v6sm4450317wme.24.2018.08.10.16.55.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 16:55:46 -0700 (PDT) Subject: Re: logical decoding / rewrite map vs. maxAllocatedDescs From: Tomas Vondra To: Andres Freund Cc: Alvaro Herrera , PostgreSQL-development References: <20180809174746.aa6rbpsu4zjipzif@alvherre.pgsql> <20180810211340.nlgyfa7jlmkjcs5m@alap3.anarazel.de> <470adb65-5101-4659-d213-41bde1eef8f2@2ndquadrant.com> Message-ID: <0328ccdf-17d6-911b-ae35-c6dc4c76708a@2ndquadrant.com> Date: Sat, 11 Aug 2018 01:55:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <470adb65-5101-4659-d213-41bde1eef8f2@2ndquadrant.com> 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 08/10/2018 11:59 PM, Tomas Vondra wrote: > > ... > > I suspect there's some other ingredient, e.g. some manipulation with the > subscription. Or maybe it's not needed at all and I'm just imagining things. > Indeed, the manipulation with the subscription seems to be the key here. I pretty reliably get the 'could not read block' error when doing this: 1) start the insert pgbench pgbench -n -c 4 -T 300 -p 5433 -f insert.sql test 2) start the vacuum full pgbench pgbench -n -f vacuum.sql -T 300 -p 5433 test 3) try to create a subscription, but with small amount of conflicting data so that the sync fails like this: LOG: logical replication table synchronization worker for subscription "s", table "t" has started ERROR: duplicate key value violates unique constraint "t_pkey" DETAIL: Key (a)=(5997542) already exists. CONTEXT: COPY t, line 1 LOG: worker process: logical replication worker for subscription 16458 sync 16397 (PID 31983) exited with exit code 1 4) At this point the insert pgbench (at least some clients) should have failed with the error. If not, rinse and repeat. This kinda explains why I've been seeing the error only occasionally, because it only happened when I forgotten to clean the table on the subscriber while recreating the subscription. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services