From c3327f9eda4a880a960afb67ad2ad65b30fdbd32 Mon Sep 17 00:00:00 2001 From: Dilip Kumar Date: Tue, 27 Apr 2021 10:53:44 +0530 Subject: [PATCH v2 2/2] Fix thinko while selecting the largest transaction for streaming --- src/backend/replication/logical/reorderbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 981619f..3e53144 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -3387,7 +3387,7 @@ ReorderBufferLargestTopTXN(ReorderBuffer *rb) txn = dlist_container(ReorderBufferTXN, node, iter.cur); - if ((largest != NULL || txn->total_size > largest_size) && + if ((largest == NULL || txn->total_size > largest_size) && (txn->base_snapshot != NULL) && (txn->total_size > 0) && !(rbtxn_has_incomplete_tuple(txn))) { -- 1.8.3.1