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 1pzeAu-0000i3-63 for pgsql-bugs@arkaria.postgresql.org; Thu, 18 May 2023 14:00:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pzeAr-0006nF-Ia for pgsql-bugs@arkaria.postgresql.org; Thu, 18 May 2023 14:00:09 +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 1pzeAr-0006n6-9R for pgsql-bugs@lists.postgresql.org; Thu, 18 May 2023 14:00:09 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pzeAn-000V2O-Dn for pgsql-bugs@lists.postgresql.org; Thu, 18 May 2023 14:00:08 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f27b65bbf9so2354618e87.0 for ; Thu, 18 May 2023 07:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684418402; x=1687010402; 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=HDTyYs0weGWNC2aYxFhZV4zk1ecsfP70ehXiSa3ZTgc=; b=JSq+mW2hNouUQ9pdEPx9EaX7Vi687mHCCRonlL38lKywhj5dkUVImKIMIKp48DJf9O MrTJ2SXsAEC1CCmuhEuMaf13nNG9KCnbWmhGzBAasPonyHZYzUxA77S1bIXL1Zx7o1Cu AzN7lHBBgiJ2ICvObrjc+2qo7N5EV47zdLjZ0Mss4czS7J92ZgdQBIy5drMklSXonTIm NjhY3k8f/WVDufrVnIc7K4ahIqbjcobsRU3SRHpdi9LBiLspkJ081lvFdNOJh6lDZCHI tHIyOJezDw4ObU5hRHevqMcYekl8/QxHifUK65jWpbaIna23TGqOhmUYMNiakv0yWso6 QODw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684418402; x=1687010402; 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=HDTyYs0weGWNC2aYxFhZV4zk1ecsfP70ehXiSa3ZTgc=; b=PQwJIXgvlFUKshDqR3w6RN/0DS24r51hdgRgs5XOGmgfnZryAubqHiH9pVfD2RjXjZ qyupBlz9yMLybne+Vlf8zBNssBzkXLH/AxVItsa2Ozqn2IDSYkmKWiacRtQwejxLuzva xGSRPKFC4dRIR6WovZpBFxMUAq1HT9ERpmh9SRucdM1EYPbwmF4hUb/kNbukasCfhl96 nzQI2RoG8ooGODoyyUmi/3gogZXN9UeKlC4YncKNYg62/6gjpez5inBglUdjdhZWNzZ/ OUez6O+8y88DvYUgwcBlPCk1tatxFk9g+zy/3DB9Y6+kzeJ6W/0nvZMbubj15PWLqG6t fyhw== X-Gm-Message-State: AC+VfDym2tNJxOUYq5diRuwCEK57Ogeec9gT70FZYClyAww/rcXBpQlt 7zRWRo499NeUcCWeWPthfv0= X-Google-Smtp-Source: ACHHUZ5zrT3BXTB1K4Bl76F37XlEXSdAl1rvPtQk5S4zvrbucNumFdCOs4jQ5k47oyKZRuIgjQGzNw== X-Received: by 2002:ac2:4286:0:b0:4f1:1de7:1aaf with SMTP id m6-20020ac24286000000b004f11de71aafmr1209173lfh.69.1684418402317; Thu, 18 May 2023 07:00:02 -0700 (PDT) Received: from [1.0.0.7] ([81.23.166.126]) by smtp.gmail.com with ESMTPSA id w25-20020a05651204d900b004f37ae2e718sm268687lfq.3.2023.05.18.07.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 May 2023 07:00:01 -0700 (PDT) Message-ID: <7e4d4a80-3e3c-231f-f886-6cada2aa582b@gmail.com> Date: Thu, 18 May 2023 17: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 , Daniel Gustafsson Cc: bowenshi , "pgsql-bugs@lists.postgresql.org" References: <17695-6be9277c9295985f@postgresql.org> 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 Hello Sawada-san, 17.05.2023 08:34, Masahiko Sawada wrote: > > When it comes to the original issue, I already shared the reproducible > steps[4] and I've confirmed again with the steps that the issue still > happens on 14 or later and the patch . However I don't find a way to > reproduce it without sleep/gdb attach. I can easily (without gdb and sleep()) reproduce the issue on master with the following script: numclients=10 rm -rf contrib/test_decoding_* for ((c=1;c<=numclients;c++)); do   cp -r contrib/test_decoding contrib/test_decoding_$c done for ((c=1;c<=numclients;c++)); do   EXTRA_REGRESS_OPTS="--dbname=regress_$c" make -s installcheck-force -C contrib/test_decoding_$c USE_MODULE_DB=1 >"installcheck-$c.log" 2>&1 & done wait It leads to: TRAP: failed Assert("builder->next_phase_at == InvalidTransactionId"), File: "snapbuild.c", Line: 1628, PID: 907918 ... 2023-05-18 16:23:33.290 MSK [907502] LOG:  server process (PID 907918) was terminated by signal 6: Aborted 2023-05-18 16:23:33.290 MSK [907502] DETAIL:  Failed process was running: SELECT count(*) FROM pg_logical_slot_get_changes('regression_slot_stats1', NULL, NULL, 'skip-empty-xacts', '1'); ... Core was generated by `postgres: postgres regress_10 [local] SELECT                  '. Program terminated with signal SIGABRT, Aborted. warning: Section `.reg-xstate/907918' in core file too small. #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140405033059264) at ./nptl/pthread_kill.c:44 44      ./nptl/pthread_kill.c: No such file or directory. (gdb) bt #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140405033059264) at ./nptl/pthread_kill.c:44 #1  __pthread_kill_internal (signo=6, threadid=140405033059264) at ./nptl/pthread_kill.c:78 #2  __GI___pthread_kill (threadid=140405033059264, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3  0x00007fb29a0cc476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4  0x00007fb29a0b27f3 in __GI_abort () at ./stdlib/abort.c:79 #5  0x0000557371bd57bb in ExceptionalCondition (     conditionName=conditionName@entry=0x557371d56860 "builder->next_phase_at == InvalidTransactionId",     fileName=fileName@entry=0x557371d572e7 "snapbuild.c", lineNumber=lineNumber@entry=1628) at assert.c:66 #6  0x0000557371a28a29 in SnapBuildSerialize (builder=builder@entry=0x557372879158, lsn=lsn@entry=312723008)     at snapbuild.c:1628 #7  0x0000557371a2a657 in SnapBuildProcessRunningXacts (builder=builder@entry=0x557372879158, lsn=312723008,     running=running@entry=0x557373095190) at snapbuild.c:1230 ... If it would be helpful, I can reduce it to concrete sql queries. Best regards, Alexander