From: Tom Lane Date: Thu, 30 Jun 2016 16:37:02 +0000 (-0400) Subject: Fix typo in ReorderBufferIterTXNInit(). X-Git-Tag: REL9_4_9~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1843d88e0d3ffb1f2f1c4457e42f25d3bf1c8505;p=postgresql Fix typo in ReorderBufferIterTXNInit(). 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.5791.22512@wrigleys.postgresql.org> --- diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index bb69bd439b..7ff6f9b58a 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -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);