Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xQN0q-0000000020F-3tN7 for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Nov 2026 10:54:08 +0000 Received: from localhost ([127.0.0.1]:36506 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xQMzq-00000000GGk-0XaL for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Nov 2026 10:53:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:47594) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xQMzp-00000000GGb-3eWP for pgsql-bugs@lists.postgresql.org; Mon, 09 Nov 2026 10:53:06 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xQMzp-000000000m8-09zG for pgsql-bugs@lists.postgresql.org; Mon, 09 Nov 2026 10:53:05 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4a208d93758so7204075e9.3 for ; Mon, 09 Nov 2026 02:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794221583; x=1794826383; darn=lists.postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=P8bO5HLmrGFg8iRdeVbUxF5rEetX7XB1n5an9aw38p4=; b=sH/RxxDYxCZQAkGJuz1hhktan3Fg7dPR3CWdJSdOviq0JBot/jm7fzdWJNtvz7I9f3 V8saHFlkLLaorth7XAIO9Q0wL8b3HyCYd/cIHVnbE9GihKffH3ua4EHkXaqUHy/Twl6F jEC3INZezoCRwkrCBEAaIdQMVRAzBIHQvH46pZNb81XsWFSe57iM0M9FSBL3T95CnEYp 7sz5DOW2fKxwvpKJ/gxlC3NwqjZkaA38aiLqDYJlcreHdQrq6bDoXPRXwvazsCUUb7Jx gBz2EXY70BV6pL2kqC8E/fFczoZqaa/A1aV3xQLJQm4+hApElypKpGNL/q/YQyllgSvf 5IQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794221583; x=1794826383; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=P8bO5HLmrGFg8iRdeVbUxF5rEetX7XB1n5an9aw38p4=; b=p6N8YERngwspi4zz5aqd4CPf3/kky/1c9L8BJQTuOB2ZpwJJ7C9E4MGeM+ns6ISOP0 QX8tYSiTKPDRTcJqPybCziaUACQ6o1lGKnkyAJg7rKauIHGbsyJKB2V/d65lXi7ZYKbn Hbv2FnDTy8HwgnfWqFWsDXNcETgLeiFArh12g9Ixh7b527qWmrNTiN8DArLYUBsLvbrF NJwWYxDvtAH456AcqQcn8aDTt3nelsZYWpA1Q5WJZFNg3PWkL+hF4CL+ySzWfafqSrhh Xc2YiEhsIraMY7RPnsR0+Xdov+7PJxhpo7eBFcC360THlPd/vWhvUl3Tcns/W0/9/WSM PmqA== X-Forwarded-Encrypted: i=1; AL+hErHDkHVsV/pdeaf2Hq6Huy8tPD3gMoXWfxMAAT7/IHLlKGRCL+nzwUHGiyQS1RKrtiDZHLcO3eWYniCd@lists.postgresql.org X-Gm-Message-State: APuU4Z/IGP7sLK7QyYeVT0EACxwL/oI1RmgoQr5p+0G2Ea5xtpqOKdYQ EU8DCMOoHU2RtHXXM84Kx4V1kwGlNI0G6xSlETs1G9CBMNLJvrS2HZ21 X-Gm-Gg: AYBFou0wvwoKxV+i7UBirKSb+7pZF//+kB+5Kl3UCSDYxb6RqlwCjuNvw13d6m7Le5Z baNRkUXD6v1242Xznjs/HH6lUwnhs0Lfrob2KfrxBJrAbYnKuUPv9Gff7RJLsespb5lBOu8wrxc /P3gD3iJ/oDa99FQNEMJjh+u0gnBaP/6V3U8TP+LIRnF8IpWgmviN+jgrhxd2/nQTcS6lBa5W16 Q/4mZogbwq0jUfEKFmY8SmJRcGDJ4uZoUUTOTZlLNd/8QstFy/ceQ9GS2Ei5GWLWjE4V11sYL9O 79I1yBxJGmYKeE/3893TU8ZsLmSwx83ctQqzKSDYYJDRcp+0Ro1YD2iXNuXMjNoZyY+wwXRbVRD EGkkzRAHugmHCkarOaRubKmiRfNYBsxBWnbDql3tUaRqhYdC2rX6bn/xyEVgRdVasKnFQFCJv3n WcK6ZOIKZ9p+4lH4iinuiB7FDpyyRYx1075oKJKYIUDdkg712hVqP7uXfARtQJKe7xrxPqtZm6/ bRQ1qA67BQ/kYpID6lAGdwD/qaUpk3wNUfwE/PKWSxOuJo8uYqmnballo84p2Klim8u4x97s8Ia aYRs3Cjx8hLXdtIL9FO419x8TXUcte3LkklxNpAPhDjVXXey4naA+hlQJD7o2f1myfoO/namcAF +/BUFa33xUBE= X-Received: by 2002:a05:600c:4e87:b0:4a1:fe55:88ef with SMTP id 5b1f17b1804b1-4b963c8dad3mr64843445e9.20.1794221583127; Mon, 09 Nov 2026 02:53:03 -0800 (PST) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b7d54d6f93sm362905105e9.0.2026.11.09.02.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 02:53:02 -0800 (PST) Date: Mon, 9 Nov 2026 10:53:01 +0000 From: Bertrand Drouvot To: Zhijie Hou Cc: Atisss hh <125atishprak@gmail.com>, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19839: Assert in ReorderBufferRestoreCleanup for aborted, spilled transaction Message-ID: References: <19839-ead02c2208a3f8bd@postgresql.org> <1da45744-968f-4f40-addf-dc085e928ec5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1da45744-968f-4f40-addf-dc085e928ec5@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Nov 08, 2026 at 11:11:09PM +0800, Zhijie Hou wrote: > Thanks for the report and patch. +1. > See the attachment for a test to reproduce this issue. (Feel free to merge > if it's worth adding a test to cover this path) > I think in a rare case, this can also affect the stats collection for > spilled txns. For example, if an empty subtransaction is marked as > serialized, we skip incrementing spillTxns because no changes were written; > if real changes are later serialized in this subtransaction, we still do not > increment spillTxns because the subtransaction is already marked as > serialized and we avoid counting it "twice". Agreed. That's why I think the test is worth adding (as the bug could also produce real user visible impact as it can cause spill_txns to be undercounted on non assert enabled builds). The test only detects the regression on assert enabled builds, but I think that is enough. A test for the spill_txns case would be more complicated and is probably not worth it. > > + if (spilled) > + txn->txn_flags |= RBTXN_IS_SERIALIZED; > > ReorderBufferSerializeTXN() already has an "if (spilled)" block right above > this, so we shall directly move the assignment into that block. +1. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com