Thanks for the report.
It appears that you hit a corner case bug: if the number of updated
tuples at a victim node(to-be-degerated-node, in this case sd3db2) is
0, no failover event happens. Included patches should fix the problem.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
> Hi Tatsuo,
>
> I'm running pgpool2 version 3.0 and have the following setup:
> replication_stop_on_mismatch = true
> failover_if_affected_tuples_mismatch = true
> replicate_select = false
>
> However, from the following example, I'm not sure why there is no
> failover happen when the update sql fails due to the updated tuples
> are not match. There is only 1 record in sd3db1 and 0 record in
> sd3db2.
>
> After tested again, I noticed that it (failover) works when there are
> 2 records in db1 and 1 record in db2. It looks like to me the
> failover is not working when there has 0 record in the db2 for the
> update sql.
>
> Any idea ?
>
> Thanks,
> Gary
>
>
> [sd3uat1.uat1_admin].gfu> show pool_nodes;
> hostname | port | status | lb_weight
> ----------+------+--------+-----------
> sd3db1 | 5432 | 2 | 0.500000
> sd3db2 | 5432 | 2 | 0.500000
> (2 rows)
>
> [sd3uat1.uat1_admin].gfu> select * from tmp;
> id
> ----
> 10
> (1 row)
>
> [sd3uat1.uat1_admin].gfu> update tmp set id=11;
> ERROR: pgpool detected difference of the number of inserted, updated
> or deleted tuples. Possible last query was: "update tmp set id=11;"
> HINT: check data consistency between master and other db node
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Succeeded.
> [sd3uat1.uat1_admin].gfu> select * from tmp;
> id
> ----
> 10
> (1 row)
>
> [sd3uat1.uat1_admin].gfu> show pool_nodes;
> hostname | port | status | lb_weight
> ----------+------+--------+-----------
> sd3db1 | 5432 | 2 | 0.500000
> sd3db2 | 5432 | 2 | 0.500000
> (2 rows)
>
>
Index: pool_proto_modules.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/pool_proto_modules.c,v
retrieving revision 1.88
diff -c -r1.88 pool_proto_modules.c
*** pool_proto_modules.c 19 Oct 2010 08:57:18 -0000 1.88
--- pool_proto_modules.c 20 Oct 2010 00:14:33 -0000
***************
*** 2804,2810 ****
* master_node: The master node id. Less than 0 means ignore this parameter.
* number_of_nodes: Number of elements in victim nodes array.
*
! * Note: If no one wins and master_node > 0, winner would be the
* master and other nodes who has same number of tuples as the master.
*
* Caution: Returned victim node array is allocated in static memory
--- 2804,2810 ----
* master_node: The master node id. Less than 0 means ignore this parameter.
* number_of_nodes: Number of elements in victim nodes array.
*
! * Note: If no one wins and master_node >= 0, winner would be the
* master and other nodes who has same number of tuples as the master.
*
* Caution: Returned victim node array is allocated in static memory
***************
*** 2900,2906 ****
/* Make victim nodes list */
for (i=0;i<nmembers;i++)
{
! if (ntuples[i] > 0 && ntuples[i] != majority_ntuples)
{
victim_nodes[(*number_of_nodes)++] = i;
}
--- 2900,2906 ----
/* Make victim nodes list */
for (i=0;i<nmembers;i++)
{
! if (ntuples[i] >= 0 && ntuples[i] != majority_ntuples)
{
victim_nodes[(*number_of_nodes)++] = i;
}
_______________________________________________
Pgpool-general mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-general