]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove obsolete speculative insert cleanup in ReorderBuffer.
authorAmit Kapila <akapila@postgresql.org>
Mon, 16 Mar 2026 04:44:22 +0000 (10:14 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 16 Mar 2026 04:44:22 +0000 (10:14 +0530)
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 <ah@cybertec.at>
Discussion: https://postgr.es/m/23256.1772702981@localhost

src/backend/replication/logical/reorderbuffer.c

index 4c230bcc8e4811e6281995c59235b8920d24b24e..682d13c9f22f088888eced4592e1362def70812f 100644 (file)
@@ -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);