Fix typo in ReorderBufferIterTXNInit().
authorTom Lane
Thu, 30 Jun 2016 16:37:02 +0000 (12:37 -0400)
committerTom Lane
Thu, 30 Jun 2016 16:37:02 +0000 (12:37 -0400)
This looks like it would cause changes from subtransactions to be missed
by the iterator being constructed, if those changes had been spilled to
disk previously.  This implies that large subtransactions might be lost
(in whole or in part) by logical replication.  Found and fixed by
Petru-Florin Mihancea, per bug #14208.

Report: <20160622144830[email protected]>

src/backend/replication/logical/reorderbuffer.c

index bb69bd439befaa243780ca23f2606efae6716bab..7ff6f9b58a732092ccd59d09cdc6627df439d53a 100644 (file)
@@ -895,7 +895,7 @@ ReorderBufferIterTXNInit(ReorderBuffer *rb, ReorderBufferTXN *txn)
        {
            ReorderBufferChange *cur_change;
 
-           if (txn->nentries != txn->nentries_mem)
+           if (cur_txn->nentries != cur_txn->nentries_mem)
                ReorderBufferRestoreChanges(rb, cur_txn,
                                            &state->entries[off].fd,
                                            &state->entries[off].segno);