pgsql: Fix the bugs in selecting the transaction for streaming.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix the bugs in selecting the transaction for streaming.
Date: 2021-04-30 05:30:16
Message-ID: E1lcLjE-0003Z2-NN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix the bugs in selecting the transaction for streaming.

There were two problems:
a. We were always selecting the next available txn instead of selecting it
when it is larger than the previous transaction.
b. We were selecting the transactions which haven't made any changes to
the database (base snapshot is not set). Later it was hitting an Assert
because we don't decode such transactions and the changes in txn remain as
it is. It is better not to choose such transactions for streaming in the
first place.

Reported-by: Haiying Tang
Author: Dilip Kumar
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/OS0PR01MB61133B94E63177040F7ECDA1FB429@OS0PR01MB6113.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ee4ba01dbbc31daa083f434ecd603a80bbe50501

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 38 +++++++++++++++----------
1 file changed, 23 insertions(+), 15 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-04-30 18:10:49 pgsql: Disallow calling anything but plain functions via the fastpath A
Previous Message David Rowley 2021-04-30 02:47:04 pgsql: Adjust EXPLAIN output for parallel Result Cache plans