From: Amit Kapila Date: Mon, 16 Mar 2026 04:44:22 +0000 (+0530) Subject: Remove obsolete speculative insert cleanup in ReorderBuffer. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f39698c9028554850fca6d3f764449c0da76d99;p=thirdparty%2Fpostgresql.git Remove obsolete speculative insert cleanup in ReorderBuffer. Commit 4daa140a2f introduced proper decoding for speculative aborts. As a result, the internal state is guaranteed to be clean when a new speculative insert is encountered. This patch removes the defensive cleanup code that is no longer reachable. Author: Antonin Houska Discussion: https://postgr.es/m/23256.1772702981@localhost --- diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 4c230bcc8e4..682d13c9f22 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -2447,12 +2447,8 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, * CheckTableNotInUse() and locking. */ - /* clear out a pending (and thus failed) speculation */ - if (specinsert != NULL) - { - ReorderBufferFreeChange(rb, specinsert, true); - specinsert = NULL; - } + /* Previous speculative insertion must be aborted */ + Assert(specinsert == NULL); /* and memorize the pending insertion */ dlist_delete(&change->node);