[pgpool-hackers: 2018] Re: [pgpool-committers: 3790] pgpool: Fix load balancing bug in streaming replication mode.

Tatsuo Ishii ishii at sraoss.co.jp
Mon Jan 30 16:43:31 JST 2017


For a record, here is the test data for Pgproto
(https://github.com/tatsuo-ishii/pgproto).
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

--------------------------------------------------------
# Test data for bug271.

# Create test table
'Q'	"DROP TABLE IF EXISTS pgproto_test1"
'Y'
'Q'	"CREATE TABLE pgproto_test1(i INT)"
'Y'

# Start a transaction
'P'	"S1"	"BEGIN"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"

# Issue SELECT
'P'	"S1"	"SELECT 1"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"

# Issue INSERT
'P'	"S1"	"INSERT INTO pgproto_test1 VALUES(1)"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"
#'S'
#'Y'

# Issue SELECT. This should be sent to primary node.
'P'	"S1"	"SELECT 1"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"

# Issue COMMIT
'P'	"S1"	"COMMIT"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"
'S'
'Y'
'X'
--------------------------------------------------------


From: Tatsuo Ishii <ishii at postgresql.org>
Subject: [pgpool-committers: 3790] pgpool: Fix load balancing bug in streaming replication mode.
Date: Mon, 30 Jan 2017 07:39:37 +0000
Message-ID: <E1cY6Yr-00053r-1Y at gothos.postgresql.org>

> Fix load balancing bug in streaming replication mode.
> 
> In an explicit transaction, any SELECT will be load balanced until
> write query is sent. After writing query is sent, any SELECT should be
> sent to the primary node. However if a SELECT is sent before a sync
> message is sent, this does not work since the treatment of writing
> query is done after ready for query message arrives. Solution is, the
> treatment for writing query is done in executing the writing query as
> well.
> 
> The bug has been there since V3.5.
> 
> Branch
> ------
> master
> 
> Details
> -------
> http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=f217239c0b92aaa6324c2c4ade8a3a7622af8a09
> 
> Modified Files
> --------------
> src/protocol/pool_proto_modules.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
> 


More information about the pgpool-hackers mailing list