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 1nJDyo-0000CF-N1 for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Feb 2022 12:27:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJDyH-0006oK-Vm for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Feb 2022 12:27:17 +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 1nJDyH-0006o2-BS for pgsql-hackers@lists.postgresql.org; Sun, 13 Feb 2022 12:27:17 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nJDyD-0002Il-5i for pgsql-hackers@lists.postgresql.org; Sun, 13 Feb 2022 12:27:15 +0000 Received: by mail-ed1-x533.google.com with SMTP id g7so7135272edb.5 for ; Sun, 13 Feb 2022 04:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=QjJw1I1ZfXKkmvC6ReCZ8rNEgElXSrm/8s84w6kmav0=; b=MYoMOY3amoydZHGAbodvuq7617fcW9tjUyvkC3hOvyJNhg9Tr8MTNBErfbD0rQrip7 JuhU0YJZBprQAp8HGs8UGNQhQkn64D0QczH+BGmH7ooTHD6h9NqfZiZjtGe0tKDIv5Br VOfee5wq+pgmdd/VrgkMst7uiFdhcLvhpQsZWm1zwTha3Ab/TjvbELzFKXigI4paHHFL e/sFfdSqJbq6F7Vm3HClz6pu10/ODPq5BTZqgPX2Vw+1BxzQ4Ym8fotn4u0rhw9yRaZk QnrA60NoRu+VMyZnXGpKvFzpY8V2zL8jF+Mg18XDpni5AufItREXj3l5K5yxIajmhY3a hg6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=QjJw1I1ZfXKkmvC6ReCZ8rNEgElXSrm/8s84w6kmav0=; b=oH1rNJFVOUTRnuV1Z2WUZ3zmxe5q4F+roiFG7c7q8rESZfRhrD31Xux1HP7TijwuAm EPWQq/bUD3IDtkrjGQ5FS/7+6ipgl84SPljbLOPY5QrptQeDwrNpojVHSTA7nnLnwpCM S5MYXDAzaQ0hLdGQNSZzQnQQeQRDPFqAYI7r7HAwEERGMzCr7N5R474TIWNbB4laWoFA XzbzwS/jQ7YUWB4RzT4IdJdYePiHuqVw9xq0tLyaG7iOAldDtGlqFBvqaLwhmTNvwO1P x/uvORKwth+dKS7BghYtQGEi8h46AlHJi5a48ROs4AczdxxJTDtlAA7IEKzqxf/0D/zM crvg== X-Gm-Message-State: AOAM533gKXRgWxYF3rbNmpSZbBdcNYw4dCP/usNuxgNJ7s/6OxZ+6kO0 5+n+5rRFWlVA5NDbiLr3XhBr8eNQ6icH7UuLVOYofZxlZTNbuUn2WJQOfWA/094vo5DmTDU0FxB BterE3sHGUQst12HOyul7l1tEcekGQvWK4YLztuQm3cVEN8zlP2cRHQyZv3/usomfrzbGaWDYN4 /OX4LQRdyg0s7jPs3HbYBrvPVd78N+VRpDocYrS69DM20LCHkemyDZ X-Google-Smtp-Source: ABdhPJy8Nd+EO/jxNY56GL/PfDAOfoz/bo7+97rxsGtvOodxeF8yRst/UcvEVSDOK7fVEAeuIhONlQ== X-Received: by 2002:a05:6402:1601:: with SMTP id f1mr10689938edv.165.1644755230771; Sun, 13 Feb 2022 04:27:10 -0800 (PST) Received: from [10.137.0.19] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id p4sm8555777ejm.47.2022.02.13.04.27.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 04:27:10 -0800 (PST) Message-ID: <67b46634-6916-4e6a-15c4-fad43f2fa0c1@enterprisedb.com> Date: Sun, 13 Feb 2022 13:27:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 1173, ... Content-Language: en-US To: Andres Freund , pgsql-hackers@lists.postgresql.org, Thomas Munro , pgsql-hackers References: From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/13/22 01:28, Andres Freund wrote: > Hi, > > On February 12, 2022 3:57:28 PM PST, Thomas Munro wrote: >> Hi, >> >> I don't know what happened here, but I my little script that scrapes >> for build farm assertion failures hasn't seen this one before now. >> It's on a 15 year old macOS release and compiled with 15 year old GCC >> version, for some added mystery. >> >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=locust&dt=2022-02-12%2022%3A07%3A21 >> >> 2022-02-13 00:09:52.859 CET [92423:92] pg_regress/replorigin >> STATEMENT: SELECT data FROM >> pg_logical_slot_get_changes('regression_slot', NULL, NULL, >> 'include-xids', '0', 'skip-empty-xacts', '1', 'include-sequences', >> '0'); >> TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: >> "reorderbuffer.c", Line: 1173, PID: 92423) >> 0 postgres 0x00592dd0 ExceptionalCondition + 160\\0 >> 1 postgres 0x00391c40 >> ReorderBufferGetRelids + 304\\0 >> 2 postgres 0x00394794 >> ReorderBufferAllocate + 1044\\0 >> 3 postgres 0x003834dc heap_decode + 76\\0 >> 4 postgres 0x003829c8 >> LogicalDecodingProcessRecord + 168\\0 >> 5 postgres 0x0038a1d4 >> pg_logical_emit_message_text + 1876\\0 >> 6 postgres 0x00241810 >> ExecMakeTableFunctionResult + 576\\0 >> 7 postgres 0x002576c4 >> ExecInitFunctionScan + 1444\\0 >> 8 postgres 0x00242140 ExecScan + 896\\0 >> 9 postgres 0x002397cc standard_ExecutorRun + 540\\0 >> 10 postgres 0x00427940 >> EnsurePortalSnapshotExists + 832\\0 >> 11 postgres 0x00428e84 PortalRun + 644\\0 >> 12 postgres 0x004252e0 pg_plan_queries + 3232\\0 >> 13 postgres 0x00426270 PostgresMain + 3424\\0 >> 14 postgres 0x0036b9ec PostmasterMain + 8060\\0 >> 15 postgres 0x0029f24c main + 1356\\0 >> 16 postgres 0x00002524 start + 68\\0 > > I think that may be the bug that Tomas fixed a short while ago. He > said the skip empty xacts stuff didn't yet work for sequences. That's > only likely to be hit in slower machines... > I'm not sure how could this be related to the issue fixed by b779d7d8fd. That's merely about handling of empty xacts in the output plugin, it has little (nothing) to do with reorderbuffer - the failures was simply about (not) printing BEGIN/COMMIT for empty xacts. So why would it be triggering an Assert in reorderbuffer? Also, there was a successful run with the test_decoding changes 80901b3291 (and also with sequence decoding infrastructure committed a couple days ago) ... Do we have access to the machine? If yes, it'd be interesting to run the tests before the fix, and see how often it fails. Also, printing the LSN would be interesting, so that we can correlate it to WAL. BTW it's probably just a coincidence, but the cfbot does show a strange failure on the macOS machine [1], as if we did not wait for all changes to be applied by replica. I thought it's because of the issue with tracking LSN for sequences [2], but this is with a reworked test that does not do just nextval(). So I'm wondering if these two things may be related ... both things happened on macOS only. [1] https://cirrus-ci.com/task/6299472241098752 [2] https://www.postgresql.org/message-id/712cad46-a9c8-1389-aef8-faf0203c9be9%40enterprisedb.com -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company