[pgpool-general: 5738] pgpool detected difference of the number of inserted, updated, or deleted tuples. - but there is none?
Benjamin Firl
bf at wisit.com
Thu Sep 21 18:00:59 JST 2017
Hi,
sorry to bother you again in such a short time. But as I have written in
"[pgpool-general: 5729] Re: pgpool says its degenerating a backend, but
it does not..." we have some problems with pgpool saying db nodes are
not in sync. I could not find any problems in our code, so I wrote a
little shell script to demonstrate the issue. It uses psql to send
request in parallel to pgpool with 2 connected db nodes:
/#!/bin/bash//
//
//NUMBER_OF_PROCESSES=2//
//TEST_COUNT=4//
//
//function testDb()//
//{//
// for i in $(seq 1 $(($TEST_COUNT/$NUMBER_OF_PROCESSES)))//
// do//
// echo "$1: $i"//
// psql -U postgres -p 5433 test -c "DELETE FROM test;
INSERT INTO test VALUES ($RANDOM);"//
//# psql -U postgres -p 5433 test -c "INSERT INTO test
VALUES ($RANDOM); DELETE FROM test;"//
//# psql -U postgres -p 5433 test -c "DELETE FROM test;"//
//# psql -U postgres -p 5433 test -c "INSERT INTO test
VALUES ($RANDOM);"//
// done//
//}//
//
//for i in $(seq 1 $NUMBER_OF_PROCESSES)//
//do//
// testDb $i &//
//done//
//
//wait//
//
//echo $(($TEST_COUNT/$NUMBER_OF_PROCESSES*$NUMBER_OF_PROCESSES))
entries tested./
Output is always something like this:
/# ./testDb.sh//
//2: 1//
//1: 1//
//INSERT 0 1//
//2: 2//
//ERROR: pgpool detected difference of the number of inserted, updated
or deleted tuples. Possible last query was: "DELETE FROM test; INSERT
INTO test VALUES (3469);"//
//HINT: check data consistency between master and other db node//
//ERROR: pgpool detected difference of the number of inserted, updated
or deleted tuples. Possible last query was: "DELETE FROM test; INSERT
INTO test VALUES (3469);"//
//HINT: check data consistency between master and other db node//
//1: 2//
//INSERT 0 1//
//ERROR: pgpool detected difference of the number of inserted, updated
or deleted tuples. Possible last query was: "DELETE FROM test; INSERT
INTO test VALUES (21477);"//
//HINT: check data consistency between master and other db node//
//ERROR: pgpool detected difference of the number of inserted, updated
or deleted tuples. Possible last query was: "DELETE FROM test; INSERT
INTO test VALUES (21477);"//
//HINT: check data consistency between master and other db node//
//4 entries tested./
If I check manually after the script was running, all nodes have the
same table content. Also if I use one of the other (commented out)
variants in the script, everything works fine.
What is the problem here?
Thanks in advance
Benjamin Firl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20170921/8656b811/attachment.htm>
More information about the pgpool-general
mailing list