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 1xQQeZ-000000006YR-3aCe for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Nov 2026 14:47:23 +0000 Received: from localhost ([127.0.0.1]:49618 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xQQeY-00000001cun-18Qe for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Nov 2026 14:47:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:46506) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xQQeY-00000001cuf-05oX for pgsql-bugs@lists.postgresql.org; Mon, 09 Nov 2026 14:47:22 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xQQeW-000000002yI-3f5b for pgsql-bugs@lists.postgresql.org; Mon, 09 Nov 2026 14:47:21 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-49134c8509fso816673f8f.1 for ; Mon, 09 Nov 2026 06:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794235639; x=1794840439; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding: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=rWS6xzipNI6hnNQaJaS3IGl1wosi0rsHnxIyG5TjKEM=; b=brpC3gwA9+mhE1vT7QRckcoBDUUlOqEVfhru7xQ9uv2QPyUhAejulZU+FvQ8EBwhKb /o8U/vVHDQncV1LKUupygynvNlq3y6lANQomgfBJIHwmKQQn+XLIK0nanH6Hx4StRucK al+bNCq9ToTZJ16GoHt37ESBTArVieSHw6rMOd5lozSX/pslbmgVixYN5LvZ5bo8YvJ7 FPDXSwC5L8pB95sxpl+D7tCW6K/a8q2Sqo5Dn7bKO6d/X7ou99ZfbKPelME1Fv267SLc jcoZ2XePx4e8K7Emx93QpnIpO/rbVdENnAXCZr/62WXj/TOLGMtDFL6WgS7AQJAzmq2U V6PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794235639; x=1794840439; h=in-reply-to:content-transfer-encoding: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=rWS6xzipNI6hnNQaJaS3IGl1wosi0rsHnxIyG5TjKEM=; b=u2L7dezDxQ2ACKoIGyoprR+O20AeU0lDhkkGtPbREGQZ41SNXtyqy62stwbpQzEvta QtoVAj3W9heCJUS3+FuJMbK09huzjf7A1oa9Nq5axwHhwcKhFH5SX9gXtI1TkpZXvRWo vQMPl9hnJd11uUVfMYBiEoVzD8MS1MDRZPWfVQTjoPSlPFyJlZpSmZlYDcv/IRDsEsVp lt31iJkyQjYeC+BW7VG7SXwnw4PdReUKHd/0JVAEGxcaRMWbbRu0BwmDEh4UNcqWfnwU qyggMZgu3mBJQ+xaHZPQEfGQXzkCrHPVDDQvxLUH1Xsx80RWfC+NkYr4hDgX8SZgP6kA 2rBQ== X-Forwarded-Encrypted: i=1; AL+hErHJJnKVstr4vuL63pgPIZBjpHzpb0qkRrpNci0ACKmH5SX6aLIEC5ALRR51C26D+rZnOxwNOyUQHD+V@lists.postgresql.org X-Gm-Message-State: APuU4Z/NDNwTGcyJWBpiC9yn4UaolMeICOvfsww339kDvcumXd5oytWI A1dvr27HADu6N4Vh48/JEo/LcaR4UX/rdk7Sewa523ReY3OIvR3HZeVFJ+W+VA== X-Gm-Gg: AYBFou0JqcaeCU6oQERw3ZV10oGekxSy09hIsP6ntesncZ8i1fEchybDqAia3wF4UTZ LhMuQdZJwciT6HpMIT0bOldTJVVl9nnikzt5uvkbAov4ln3GnG2yhum3vPf/OtqHKF5Ka4twJNO yxhnpyzODLyzEKvJ5g/2IaziRwj8R/2PERfvuktiBYj46eh0f8ErnQvGVxx/NDQ5NcmWlqB2aJx nplEG9DXiPuZF6utoW9pklHmUNAOTnezdYCZKJLU/m/4JYxaHPe5eW8mwPiBxL1TK1hqRnBTH9A 7vHqgtkUyRV5nAEUFMWN1GOHdwyjDuWLiE4zmtiuRqvzrCHIYjK8xAf2faVRwjrLNR7Y2IdEOBV XJ2zZFBM37hAUlLuGte7JVCog76yi537MhbGxVM/zUVnbOaMLGecR1xNMDZqUbVRXW+O9ssf16I /WFa1pezqqfxP4QZDKC13rPqvybgsLaJJ6RPFTkOx66Kngsic3yjOt05Zy6G5bkJubx7thdjbkY 8oSa3Kc38pk6qiTfifRWlia0dkr4vVu6LFg/RkuEveuajtQPEiDmoc8uqlisi/ji84/ecHABkTi 3v66piltzTzfyzGc+HxGBaHNQJm9NGYeNCgXiJ7L0kkpGwz5JeQcAM5xWRbe2fsnNTYWyA7E60L uIgPokL3kyuAE X-Received: by 2002:a05:6000:4010:b0:48b:59f:db9c with SMTP id ffacd0b85a97d-49585ca3f32mr10153654f8f.53.1794235638823; Mon, 09 Nov 2026 06:47:18 -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 ffacd0b85a97d-4959650a0f1sm10485661f8f.20.2026.11.09.06.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 06:47:18 -0800 (PST) Date: Mon, 9 Nov 2026 14:47:17 +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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Nov 09, 2026 at 07:46:59PM +0800, Zhijie Hou wrote: > Thanks for the review. It looks like Atisss's update patches didn't reach > the list, probably a missing Reply-All, so I'm helping to attach the same > patches (provided by Atisss) here. LGTM, just one nit about: + /* + * Mark the transaction as serialized only if something was written, + * and only after the check above. final_lsn is advanced for each + * change written, so a transaction that wrote nothing, such as a + * subtransaction without decoded changes, would be marked with an + * invalid final_lsn, and ReorderBufferRestoreCleanup() would later + * fail on it. + */ It looks lengthy and “the check above” is ambiguous. I'm not sure we need a new comment here, maybe just replace the existing? /* update the statistics iff we have spilled anything */ with /* update the statistics and mark the transaction serialized iff we spilled */ Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com