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 1q1PkU-0007VJ-LC for pgsql-bugs@arkaria.postgresql.org; Tue, 23 May 2023 11:00:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q1PkT-00025D-D3 for pgsql-bugs@arkaria.postgresql.org; Tue, 23 May 2023 11:00:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1PkS-000254-VC for pgsql-bugs@lists.postgresql.org; Tue, 23 May 2023 11:00:13 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q1PkL-001RSZ-VX for pgsql-bugs@lists.postgresql.org; Tue, 23 May 2023 11:00:11 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b03d3e41fcso4466101fa.0 for ; Tue, 23 May 2023 04:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684839604; x=1687431604; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RiSvdP4PCpIwwY3x2Up5579xns3DctMtmGVrT56/4iI=; b=rBZAgrdGQXTSncMH3+yumhiswA/7yCW8bGQ7jsSOLhOx1x5T0C5kw6dgnIJF7K6hY1 q+Vp6WCjQh0wRiHd7fh6YbSr8oWaUilMNbuijQEi0ijJvCka+OoOTHvoNQ0rU76kuW28 L14M27LfjF5XDo6m40VA7goAHcc7lZLkNjynJjKMhAj2LW0j+aAFJUhR5t0p2AyL8tih j+3030bwngUdvzOMzJvgI2v8AMjee2c+U75KYE4K0V2NsCiVbojzggTi1j6kPWGtWCAC FOfoLtYcJnhKysb8Du/h+pCnIO9b3lcbVGSjRzWC1JxKYXYg+CUkY4aAw4L7fZNdWXUI lfOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684839604; x=1687431604; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RiSvdP4PCpIwwY3x2Up5579xns3DctMtmGVrT56/4iI=; b=W0a8Ck517MVYyq4EwyEEth1thGuF6lEwK77zD3taeQrpvPdJkKCT0iEEUpwRX1Evzp VK94kthJI1ELgjCBqx39i3cxJHBVFVZR+8c23cTi4E8EUvlP+Pbj9PdOi6G39zt7t27A NN8A6LMGpWqnowhD0VOK/6Ss9psg1Yj2qezCQQwo3tr6ITKygELp24tkVLiHHlHzt80y XKeQCBrhlkcE7Z/o3XHw7FpuV1c2Qz1Ox0PuXDupvdJs43zFKxv/Isy3IIKAld4ITkdw Iq5Nun/zFyuMc7iAy03CuzirLs2aiBaCCchbDRR+zVOze/M5+1I8sIZXNU53IwDm1ZoE Dy9w== X-Gm-Message-State: AC+VfDxcblmWYrmN1FEIMKQGIL1nOVIPwOSytQnrKHpqWN+/GjHVcn0U M+yI8B6C82m7qKcgCUn2kis= X-Google-Smtp-Source: ACHHUZ7uxPGeIMJPgbz6bIRFQHPRYiIkgkFnav0zFZvgJKMCj02r7GFxMRSskQdwI3ZNz8S3BtK8EQ== X-Received: by 2002:a2e:8559:0:b0:2ae:d911:1fb4 with SMTP id u25-20020a2e8559000000b002aed9111fb4mr4561127ljj.14.1684839603656; Tue, 23 May 2023 04:00:03 -0700 (PDT) Received: from [1.0.0.7] ([81.23.167.9]) by smtp.gmail.com with ESMTPSA id s24-20020a2e9c18000000b002af8aaebce4sm1105795lji.8.2023.05.23.04.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 May 2023 04:00:02 -0700 (PDT) Message-ID: <102cb85d-2205-c8ec-ac37-797c03e025e1@gmail.com> Date: Tue, 23 May 2023 14:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17695: Failed Assert in logical replication snapbuild. Content-Language: en-US To: Masahiko Sawada Cc: Daniel Gustafsson , bowenshi , "pgsql-bugs@lists.postgresql.org" References: <17695-6be9277c9295985f@postgresql.org> <7e4d4a80-3e3c-231f-f886-6cada2aa582b@gmail.com> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 22.05.2023 03:56, Masahiko Sawada wrote: > On Thu, May 18, 2023 at 11:00 PM Alexander Lakhin wrote: > >> I can easily (without gdb and sleep()) reproduce the issue on master with >> the following script: >> ... > Thank you for sharing the script. But it seems not stable as I could > not reproduce the issue in my environment. I think we need a stable > reproducer so that we can include it in core regression tests. Or it > may be okay not to include it if we could not find a convenient way > and the fix is trivial. I've came to the minimal reproducer: numclients=40 for ((c=1;c<=numclients;c++)); do createdb regress_$c done for ((c=1;c<=numclients;c++)); do ( echo " CREATE TABLE replication_example(id SERIAL PRIMARY KEY, somedata int, text varchar(120)); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot_$c', 'test_decoding'); SELECT data FROM pg_logical_slot_get_changes('regression_slot_$c', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); " | psql -d regress_$c >psql-$c.log ) & done wait grep TRAP server.log (I've set fsync = off wal_level = logical in postgresql.conf) When using a build made with ASAN (and gcc-12), I get several asserts at once: grep TRAP server.log  | wc -l 12 Without ASAN, I get no failures with numclients = 40, but still get series of those with numclients=80... It's hardly suitable for the regression test, but it clearly demonstrates the issue without using gdb. With the fix from [1] applied, I've got no failures, even with numclients=100, for 10 runs. I also think, that the fix is simple enough to be committed without a complicated/resource-intensive regression test. [1] https://www.postgresql.org/message-id/CAD21AoDNv09ZMr-E%2BfNzhduvkE6eK2fjCRA7wJHOhF8APH5JdQ%40mail.gmail.com Best regards, Alexander