pgpool2.git / summary / log / commit / refs

commit    1ec0ead0fd645fabe52cbf3694d6f6186a88a444
Author:   Tatsuo Ishii <ishii at sraoss.co.jp>
Date:     Sun Jan 25 11:13:18 2009 +0000

    Prepare 2.2 beta1


NEWS | 82 ++++++++++++++++++++++ TODO | 74 +++++++++++++++++++ configure | 2 +- configure.in | 2 +- doc/pgpool-en.html | 48 ++++++++----- doc/pgpool-ja.html | 203 +++++++++++++++++++++++++++++++++-------------------- version.h | 2 +- 7 files changed, 315 insertions(+), 98 deletions(-) diff --git a/NEWS b/NEWS index 073804961..ba20c75c8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,85 @@ +2.2 (urukiboshi) 2009/2/? + * Version 2.2 + + This version enhances SERIAL data type handling and on line + recovery. Also an important bug, serializable transactions could + cause data inconsistency among DB nodes, is fixed. Also query + cancelation, which never worked since pgpool-II was born, is + finally fixed. + + * New features + + - With insert_lock, now a table is locked only if it has + SERIAL data type and now the default value for insert_lock + is true(Tatsuo) + + - Add client_idle_limit_in_recovery directive. This will + prevent 2nd stage of on line recovery from not going forward + by idle clients sitting forever(Tatsuo) + + - Add pid_file_name directive which specifies a path to the + file containing pgpool process id. "logdir" is no more used(Tatsuo) + + - Allow to load balance DECLARE, FETCH and CLOSE(Tatsuo) + + * Bug fixes + + - Close all file descriptors when running in daemon mode. + Otherwise we inherit sockets from apache when it's started by + pgpoolAdmin. This results in that port 80 is occupied for + example. Patch provided by Akio Ishida. Also add + chdir("/"). This is always good for daemon programs(Tatsuo) + + - Allow MD5 authentication in raw mode as stated in docs(Tatsuo) + + - Check transaction serialization failure error in + serializable mode and abort all nodes if so. Otherwise we + allow data inconsistency among DB nodes(Tatsuo). + + See following scenario: (M:master, S:slave) + + M:S1:BEGIN; + M:S2:BEGIN; + S:S1:BEGIN; + S:S2:BEGIN; + M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + M:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + S:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + M:S1:UPDATE t1 SET i = i + 1; + S:S1:UPDATE t1 SET i = i + 1; + M:S2:UPDATE t1 SET i = i + 1; <-- blocked + S:S1:COMMIT; + M:S1:COMMIT; + M:S2:ERROR: could not serialize access due to concurrent update + S:S2:UPDATE t1 SET i = i + 1; <-- success in UPDATE and data becomes inconsistent! + + - avoid kind mismatch error caused by "SET TRANSACTION + ISOLATION LEVEL must be called before any query"(Tatsuo). + + This could happen in following scenario: + + M:S1:BEGIN; + S:S1:BEGIN; + M:S1:SELECT 1; <-- only sent to MASTER + M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + M: <-- error + S: <-- ok since no previous SELECT is sent. kind mismatch error occurs! + + - Query cancelation now works. It never works since pgpool-II + was born. + + * Incompatible changes + + - Always fail over and restart all children. Before we do + restart only if master has not been changed. This is + wrong. If we have trouble with network cable or something, + TCP/IP stack keeps on retrying for long time and the only + way to prevent it is restarting process(Tatsuo) + + * "logdir" is no more used. Instead use "pid_file_name"(Tatsuo) + 2.1 (inamiboshi) 2008/7/25 * Version 2.1 diff --git a/TODO b/TODO index 6fce4c46c..4a0ecf0d5 100644 --- a/TODO +++ b/TODO @@ -2,6 +2,80 @@ $Header$ * General +- drop table should be in a transactin block? It is judged here: + +POOL_STATUS start_internal_transaction(POOL_CONNECTION_POOL *backend, Node *node) +{ + int i; + + /* if we are not in a transaction block, + * start a new transaction + */ + if (TSTATE(backend) == 'I' && + (IsA(node, InsertStmt) || IsA(node, UpdateStmt) || + IsA(node, DeleteStmt) || IsA(node, SelectStmt))) + + example session log: + +2009-01-09 00:22:20 JST t-ishii test 853 LOG: statement: begin; +2009-01-09 00:22:23 JST t-ishii test 853 LOG: statement: lock table t1; +2009-01-09 00:22:23 JST t-ishii test 853 LOG: unexpected EOF on client connection +2009-01-09 00:22:45 JST t-ishii test 860 LOG: statement: drop table t1; +2009-01-09 00:22:46 JST t-ishii test 860 LOG: unexpected EOF on client connection +2009-01-09 00:22:49 JST t-ishii test 877 LOG: statement: drop table t1; +2009-01-09 00:22:49 JST t-ishii test 877 ERROR: table "t1" does not exist +2009-01-09 00:22:49 JST t-ishii test 877 STATEMENT: drop table t1; + + +????????? +2009-01-09 00:22:23 JST t-ishii test 854 LOG: unexpected EOF on client connection +2009-01-09 00:22:46 JST t-ishii test 861 LOG: statement: drop table t1; +2009-01-09 00:22:46 JST t-ishii test 861 ERROR: cache lookup failed for constraint 1857934 +2009-01-09 00:22:46 JST t-ishii test 861 STATEMENT: drop table t1; +2009-01-09 00:22:46 JST t-ishii test 861 LOG: could not send data to client: ??????????? +2009-01-09 00:22:46 JST t-ishii test 861 LOG: unexpected EOF on client connection +2009-01-09 00:22:49 JST t-ishii test 878 LOG: statement: drop table t1; +2009-01-09 00:22:49 JST t-ishii test 878 ERROR: cache lookup failed for constraint 1857934 +2009-01-09 00:22:49 JST t-ishii test 878 STATEMENT: drop table t1; +2009-01-09 00:25:51 JST t-ishii test 878 LOG: statement: create table t1(i int); +2009-01-09 00:25:52 JST t-ishii test 878 ERROR: relation "t1" already exists +2009-01-09 00:25:52 JST t-ishii test 878 STATEMENT: create table t1(i int); +2009-01-09 00:25:52 JST t-ishii test 878 LOG: could not send data to client: ??????????? +2009-01-09 00:25:52 JST t-ishii test 878 LOG: unexpected EOF on client connection + +- BEGIN; BEGIN; causes: + + ERROR: kind mismatch among backends 0[N] 1[E] + + detect_error() checks following NOTICE(ERRRO¤Ī25001 means /* SET + TRANSACTION ISOLATION LEVEL must be called before any query */) + + WARNING: 25001: there is already a transaction in progress + + this will send an error query to abort a transaction. + +- regression failres: + + triggers ... FAILED +test sanity_check ... FAILED + portals ... FAILED +test misc ... FAILED + plpgsql ... FAILED + largeobject ... FAILED +test tablespace ... FAILED + +======================== + 7 of 114 tests failed. +======================== + + this happens when replication true, insert_lock true, replicate_select false, + load_balance false. + + if replicate_select is true, prepared_xacts fails(because \d fails) + and prepared transactio remain, which keep a lock on pg_class in + access share mode. And alter table pg_class cannot obtain exclusive + lock, which causes all SELECTs suspend and regression cannot contiunue. + - Allow client encoding conversion. This was possible in pgpool-I - Allow special comment such as "/* STRICT */". This was possible in pgpool-I diff --git a/configure b/configure index 811a3ae27..236be96d1 100755 --- a/configure +++ b/configure @@ -2802,7 +2802,7 @@ fi # Define the identity of the package. PACKAGE=pgpool-II - VERSION=2.1 + VERSION=2.2beta1 cat >>confdefs.h <<_ACEOF diff --git a/configure.in b/configure.in index 8d9f1ded8..83c294d44 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ AC_INIT dnl Checks for programs. AC_PROG_CC -AM_INIT_AUTOMAKE(pgpool-II, 2.1) +AM_INIT_AUTOMAKE(pgpool-II, 2.2beta1) AC_PROG_RANLIB AC_PROG_LIBTOOL diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html index df37b805e..1ece690d9 100644 --- a/doc/pgpool-en.html +++ b/doc/pgpool-en.html @@ -7,7 +7,7 @@ </head> <!-- hhmts start --> -Last modified: Fri Nov 7 18:02:24 JST 2008 +Last modified: Sun Jan 25 19:28:56 JST 2009 <!-- hhmts end --> <body bgcolor="#ffffff"> @@ -52,15 +52,6 @@ and a PostgreSQL database client. It provides the following features.</p> <p> <ul> -<li>Limiting Exceeding Connections</li> - <p>There is a limit on the maximum number of concurrent -connections with PostgreSQL, and connections are rejected after this -many connections. Setting the maximum number of connections, however, -increases resource consumption and affect system -performance. pgpool-II also has a limit on the maximum number of -connections, but extra connections will be queued instead of returning -an error immediately.</p> - <li>Connection Pooling</li> <p>pgpool-II saves connections to the PostgreSQL servers, and reuse them whenever a new connection with the same properties @@ -83,6 +74,15 @@ proportionally to the number of PostgreSQL servers. Load balance works best in a situation where there are a lot of users executing many queries at the same time.</p> +<li>Limiting Exceeding Connections</li> + <p>There is a limit on the maximum number of concurrent +connections with PostgreSQL, and connections are rejected after this +many connections. Setting the maximum number of connections, however, +increases resource consumption and affect system +performance. pgpool-II also has a limit on the maximum number of +connections, but extra connections will be queued instead of returning +an error immediately.</p> + <li>Parallel Query</li> <p>Using the parallel query function, data can be divided among the multiple servers, so that a query can be executed on all the @@ -422,10 +422,17 @@ servers.</p> <dt>logdir</dt> <dd> - <p>The directory path of the logs created by - pgpool-II. Currently, only the <code>pgpool.pid</code> file is - created. Default is <code>'/tmp'</code>. - You need to restart pgpool-II if you change logdir. + <p>The directory path of the logs. pgpool-II 2.2 or later does not + use this directive. In the future pgpool-II might implement its + own logging system and we leave this directive as it is. + </p> + </dd> + + <dt>pid_file_name</dt> + <dd> + <p>Full path to a file which contains pgpool's process id. + Default is "/var/run/pgpool/pgpool.pid". + You need to restart pgpool-II if you change the value. </p> </dd> @@ -750,6 +757,7 @@ configuration parameters below must be set in addtion to everything above.</p> terminates the query. Default is false.</p> </dd> +<a name="replicate_select"> <dt>replicate_select</dt> <dd> <p>When set to true, pgpool-II replicate SELECTs. If false, @@ -840,11 +848,10 @@ be lost). To achieve this, however, the following change must be made: executed (if already in transaction, simply adds LOCK TABLE ....). - The downside for this is that pgpool-II does not know which - table has SERIAL columns, so all the INSERT statements will - acquire table locks. + As of pgpool-II 2.2, it automatically detects if the table has a + SERIAL columns or not, so only tables having SERIAL columns are locked. - To avoid this problem, there are two options: + Also you might want to make a fine control: </p> <ol> @@ -980,6 +987,11 @@ comments just in front of the SELECT query: </pre> </p> +<p> +Please refer to <a href="#replicate_select">replicate_select</a> as well. +See also a <a href="load_balance.png">flow chart</a>. +</p> + <p> <font color="red"> Note: JDBC driver has autocommit option. If autocommit is false, JDBC driver diff --git a/doc/pgpool-ja.html b/doc/pgpool-ja.html index 9e9a67975..67bc56c84 100644 --- a/doc/pgpool-ja.html +++ b/doc/pgpool-ja.html @@ -8,7 +8,7 @@ <body> <!-- hhmts start --> -Last modified: Fri Nov 7 18:01:53 JST 2008 +Last modified: Sun Jan 25 19:56:06 JST 2009 <!-- hhmts end --> <body bgcolor="#ffffff"> @@ -47,75 +47,47 @@ Last modified: Fri Nov 7 18:01:53 JST 2008 <h1>pgpool-II$B$H$O(B<a name="whatis"></a></h1> <p> -pgpool-II$B$O(BPostgreSQL$B@lMQ$N%_%I%k%&%'%"$G!$(BPostgreSQL$B$N%G!<%?%Y!<%9%/%i(B -$B%$%"%s%H$H(BPostgreSQL$B%5!<%P$N4V$K3d$j9~$`7A$GF0:n$7!$(BPostgrSQL$B$K0J2<$N$h(B -$B$&$J5!G=$rDI2C$7$^$9!%(B +pgpool-II$B$O(BPostgreSQL$B@lMQ$N%_%I%k%&%'%"$G!$(BPostgreSQL$B$N%G!<%?%Y!<%9%/%i%$%"%s%H$H(BPostgreSQL$B%5!<%P$N4V$K3d$j9~$`7A$GF0:n$7!$(BPostgrSQL$B$K0J2<$N$h$&$J5!G=$rDI2C$7$^$9!%(B </p> <p> <ul> -<li>$B@\B3?t$N@)8B(B -<p> -PostgreSQL$B$K@\B32DG=$J%;%C%7%g%s?t$K$O8B3&$,$"$j!$$=$l$rD6$($F@\B3$9$k$3(B -$B$H$O$G$-$^$;$s!%$+$H8@$C$F!$F1;~%;%C%7%g%s?t$r$`$d$_$KB?$/@_Dj$9$k$H!$%a(B -$B%b%j!<$J$I$N%j%=!<%9$,B?$/>CHq$5$l$F%Q%U%)!<%^%s%9$K1F6A$,$"$j$^$9!%(B -pgpool-II$B$G$b%/%i%$%"%s%H$+$i$N@\B3?t$K$O>e8B$,$"$j$^$9$,!$$=$l$rD6$($F$b$?(B -$B$@$A$K%(%i!<$K$J$k$3$H$O$J$/!$0lDj$N4VBT$?$5$l$k$h$&$K$J$C$F$$$^$9!%$7$?(B -$B$,$C$F!$(Bpgpool-II$B$O(BPostgreSQL$B$X$N@\B3MW5a$r<B<AE*$K%-%e!<%$%s%0$7!$(B -PostgreSQL$B$X$N2aBg$J@\B3?t$r@)8B$9$k$3$H$,2DG=$G$9!%(B -</p> - <li>$B%3%M%/%7%g%s%W!<%j%s%0(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%8%g%s$O!$(BPostgreSQL$B$N(B6.4$B0J9_$G$9!%$?$@$7%Q%i%l%k%/%(%j%b!<%I$r;HMQ$9$k$H$-$O(BPostgreSQL 7.4$B0J9_$r$*;H$$$/$@$5$$!%(B </p> <h1>pgpool-II$B$N%$%s%9%H!<%k(B<a name="install"></a></h1> @@ -128,8 +100,7 @@ href="http://pgfoundry.org/projects/pgpool/">pgpool$B3+H/%Z!<%8(B</a> <p> pgpool-II$B$N%$%s%9%H!<%k$K$O!$(Bgcc 2.9$B0J>e!$$*$h$S(BGNU make$B$,I,MW$G$9!%(B -$B$^$?!$(Bpgpool-II$B$O(Blibpq$B$r;HMQ$9$k$N$G!$%S%k%I$r9T$&%^%7%s>e$K(Blibpq$B$,%$%s%9%H!<(B -$B%k$5$l$F$$$k$3$H$,I,MW$G$9!%(B +$B$^$?!$(Bpgpool-II$B$O(Blibpq(PostgreSQL$BIUB0$N%/%i%$%"%s%H%i%$%V%i%j(B)$B$r;HMQ$9$k$N$G!$%S%k%I$r9T$&%^%7%s>e$K(Blibpq$B$,%$%s%9%H!<%k$5$l$F$$$k$3$H$,I,MW$G$9!%(B </p> <dl> @@ -339,8 +310,7 @@ pgpool-II$B$,%3%M%/%7%g%s$r<u$1IU$1$k%]!<%HHV9f$G$9!%%G%U%)%k%HCM$O(B9999 <dd> <p> pgpool-II$B$,%3%M%/%7%g%s$r<u$1IU$1$k(BUNIX$B%I%a%$%s%=%1%C%H$rCV$/%G%#%l%/%H%j$G$9!%(B -$B%G%U%)%k%HCM$O(B'/tmp'$B$G$9$,!$(Bcron$B$K$h$j>C$5$l$F$7$^$&$3$H$b$"$k$N$G!$$[$+(B -$B$N%G%#%l%/%H%j!$$?$H$($P(B/var/run$B$J$I$KCV$/$3$H$r$*$9$9$a$7$^$9!%(B +$B%G%U%)%k%HCM$O(B'/tmp'$B$G$9!#(B $B$3$N%Q%i%a!<%?$rJQ99$7$?;~$K$O(B pgpool-II $B$r:F5/F0$7$F$/$@$5$$!#(B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$r3JG<$7$?%U%!%$%k(B)$B$N%U%k%Q%9L>$G$9!%(B + $B%G%U%)%k%HCM$O(B'/var/run/pgpool/pgpool.pid'$B$G$9!%(B + $B$3$N%Q%i%a!<%?$rJQ99$7$?;~$K$O(B pgpool-II $B$r:F5/F0$7$F$/$@$5$$!#(B </p> <dt>print_timestamp @@ -768,6 +743,7 @@ raw$B%b!<%I!$%3%M%/%7%g%s%W!<%k%b!<%I$K2C$(!$0J2<$r@_Dj$7$^$9!%(B $BLd$$9g$o$;$r6/@)E*$K=*N;$9$k$@$1$KN1$a$^$9!%%G%U%)%k%HCM$O(Bfalse$B$G$9!%(B </p> +<a name="replicate_select"> <dt>replicate_select <dd> <p> @@ -861,13 +837,9 @@ replicate_select$B!$(Bload_balance_mode$B!$(BSELECT$BLd9g$o$;$,L@<(E*$J%H%i $B%s%6%/%7%g%s$N3+;O!$%F!<%V%k%m%C%/!$%H%i%s%6%/%7%g%s$N=*N;$r9T$C$F(B $B$/$l$k$N$G!$$3$&$7$?<j4V$r>J$/$3$H$,$G$-$^$9!J$9$G$K%H%i%s%6%/%7%g(B $B%s$,3+;O$5$l$F$$$k>l9g$O(BLOCK TABLE...$B$@$1$,<B9T$5$l$^$9!K!%(B - - $B$?$@!$$3$N%F!<%V%k$GK\Ev$K(BSERIAL$B7?$,;H$o$l$F$$$k$+$I$&$+$,H=Dj$5$l$k(B - $B$o$1$G$O$J$$$N$G!$(BSERIAL$B7?$r;H$C$F$$$J$$%F!<%V%k$G$b$3$&$7$?=hM}$,(B - $B9T$o$l$F$7$^$$$^$9!J5!G=>e;Y>c$,$"$k$o$1$G$O$J$$$N$G$9$,!$=hM}B.EY(B - $B$,CY$/$J$C$F$7$^$$$^$9!K!%(B - - $B$3$NLdBj$r2sHr$9$k$K$O(B2$B$D$NJ}K!$,$"$j$^$9!%(B + $B%F!<%V%k$G(BSERIAL$B7?$,;H$o$l$F$$$J$$>l9g$K$O!$%F!<%V%k$N%m%C%/$O9T$J$o$l$^$;$s!%(B + $B$J$*!$$"$^$jI,MW$J$$$+$bCN$l$^$;$s$,!$%3%a%s%H$rMxMQ$7$F!$$3$N5sF0$r(B + $B:Y$+$/@)8f$9$k$3$H$b$G$-$^$9!%(B </p> <ol> @@ -881,10 +853,7 @@ replicate_select$B!$(Bload_balance_mode$B!$(BSELECT$BLd9g$o$;$,L@<(E*$J%H%i </ol> <p> - SERIAL$B7?$r;H$C$F$$$k%F!<%V%k$,B?$$>l9g$O(B1)$B$r!$>/$J$$>l9g$O(B2)$B$r:NMQ(B - $B$9$k$HNI$$$G$7$g$&!%(B - - insert_lock$B$N%G%U%)%k%HCM$O(Bfalse$B$G$9!%(B + insert_lock$B$N%G%U%)%k%HCM$O(Btrue$B$G$9!%(B $B$J$*!$(Binsert_lock$B$rM-8z$K$7$F(Bregression test$B$r<B9T$9$k$H!$>/$/$H$b(B PostgreSQL 8.0$B$G$O(Btransactions, privileges, rules, alter_table$B$,(B @@ -962,18 +931,20 @@ replicate_select$B!$(Bload_balance_mode$B!$(BSELECT$BLd9g$o$;$,L@<(E*$J%H%i <dt>recovery_timeout <dd> <p> - pgpool $B$N%*%s%i%$%s%j%+%P%j$G$O!"%;%+%s%I%9%F!<%8$KF~$kA0$+$i!"(Bpgpool $B$,@\(B - $BB3$r<u$1IU$1$J$$;~4V$r@_$1$^$9!#$7$+$7!"%/%i%$%"%s%H$,(B pgpool $B$K@\B3(B - $B$7$?$^$^$G$"$C$?$jEy$NM}M3$G!"%;%+%s%I%9%F!<%8$KF~$l$J$$$^$^$G$"$k2D(B - $BG=@-$,$"$j$^$9!#(B - + pgpool$B$O!$%*%s%i%$%s%j%+%P%j$N:]$K$9$Y$F$N%/%i%$%"%s%H$,@\B3$r=*N;$9$k$^$GBT$A$^$9!%(B + recovery_timeout$B$G$=$N:GBgBT$A;~4V$r;XDj$7$^$9!%C10L$OIC$G$9!%(B + $BBT$A;~4V$,(Brecovery_timeout$B$r1[$($k$H!$%*%s%i%$%s%j%+%P%j$OCf;_$5$l!$DL>o$N>uBV$KLa$j$^$9!%(B </p> <p> - $B$3$N%Q%i%a!<%?$G%j%+%P%j$N:GBgIC?t$r;XDj$7$^$9!#;XDj$7$?;~4V$r1[$($k(B - $B$H(B pgpool $B$,%j%+%P%j=hM}$r%-%c%s%;%k$7!"DL>o$N@\B3$G$-$k>uBV$KLa$7$^(B - $B$9!#(B0 $B$r;XDj$7$?>l9g$OBT$?$J$$$H$$$&0UL#$K$J$j$^$9!#(B + $B%"%$%I%k>uBV$N%/%i%$%"%s%H$,@\B3<+J,$+$i@\B3$9$k$N$rBT$A$?$/$J$$>l9g$O!$(Bclient_idle_limit_in_recovery$B$rMxMQ$9$k$3$H$b$G$-$^$9!%(B +</p> </p> <p> +recovery_timeout$B$O!$$3$NB>!$%*%s%i%$%s%j%+%P%j$N:G8e$K%j%+%P%jBP>]$N(BDB$B%N!<%I$G(Bpostmaster$B$r5/F0$9$k:]$NBT$A;~4V$K$bMxMQ$5$l$^$9!%(B +</p> +<p> +recovery_timeout$B$N%G%U%)%k%HCM$O(B90$BIC$G$9!%(B +recovery_timeout$B$r(B0$B$H$7$F$b%?%$%`%"%&%H$,L58z$K$J$k$o$1$G$O$J$/!$C1$KB(:B$K%?%$%`%"%&%H$9$k$@$1$G$9$N$GCm0U$7$F$/$@$5$$!%(B $B$3$N%Q%i%a!<%?$rJQ99$7$?;~$K$O@_Dj%U%!%$%k$r:FFI$_9~$_$7$F$/$@$5$$!#(B </p> @@ -1003,6 +974,10 @@ load_balance_mode = true $B$r@_Dj$7$?>l9g!$0J2<$N>r7o$N$9$Y$F$rK~$?$7$?;~$K(BS </ul> </p> <p> + +(<a href="#replicate_select">replicate_select$B$N9`L\(B</a>$B$b;29M$K$7$F$/$@$5$$(B) +$B$^$?!$(B<a href="load_balance.png">$B>\:Y$JH=Dj>r7o$r%U%m!<%A%c!<%H$K$7$?$b(B</a>$B$N$b$4Mw2<$5$$!%(B + $B$J$*!$(B <pre> /*REPLICATION*/ SELECT ... @@ -1030,13 +1005,12 @@ PostgreSQL$B%5!<%P$N$&$A!$(B1$BBf$,%@%&%s$9$k$H!$$=$N%5!<%P$r@Z$jN%$7$F=LB`1? <h4><p>$B%l%W%j%1!<%7%g%s%b!<%I8GM-$N%(%i!<$K$D$$$F(B</p></h4> <p> -$B%G!<%?$N@09g@-$rJ]$D$?$a$K!"%l%W%j%1!<%7%g%s;~$K(B INSERT, UPDATE, -DELETE $B$N99?77o?t$,$9$Y$F$N%N!<%I$,F1$8$G$J$$>l9g$O%H%i%s%6%/%7%g%s$r(B -$B%"%\!<%H$5$;$^$9!#%/%i%$%"%s%H$K$O0J2<$N%(%i!<$rJV$7$^$9!#(B +$B%G!<%?$N@09g@-$rJ]$D$?$a$K!"(Bpgpool$B$O%l%W%j%1!<%7%g%s;~$K(B INSERT, UPDATE, +DELETE $B$N99?77o?t$,$9$Y$F$N%N!<%I$,F1$8$G$J$$>l9g!$0U?^E*$K9=J8%(%i!<$r5/$9(BSQL$B$rAw?.$9$k$3$H$K$h$C$F!$%H%i%s%6%/%7%g%s$r%"%\!<%H$5$;$^$9(B($B%U%'%$%k%*!<%P$O5/$-$^$;$s(B)$B!#0J2<$N$h$&$J46$8$K$J$j$^$9!%(B <pre> - x=# update t set a = a + 1; - ERROR: pgpool detected difference of the number of update tuples - HINT: check data consistency between master and other db node + =# UPDATE t SET a = a + 1; + ERROR: pgpool detected difference of the number of update tuples + HINT: check data consistency between master and other db node </pre> </p> @@ -1993,7 +1967,7 @@ configure $B$K<:GT$7$^$9!#I,$:(B libpq 3.0 (PostgreSQL 7.4) $B$r%j%s%/$9$k$h $B>pJs$J$I$G$9!#(B <pre> ex) - $ pcp_node_count 10 localhost 9898 postgres hogehoge + $ pcp_node_count [-d] 10 localhost 9898 postgres hogehoge $BBh0l0z?t(B - $B%?%$%`%"%&%HCM(B $BIC?t$G%?%$%`%"%&%HCM$r;XDj$7$^$9!#$3$N;~4VFb$K(Bpgpool-II$B$+$i1~(B @@ -2003,6 +1977,8 @@ configure $B$K<:GT$7$^$9!#I,$:(B libpq 3.0 (PostgreSQL 7.4) $B$r%j%s%/$9$k$h $BBh;00z?t(B - pgpool-II$B$,<u$1IU$1$F$$$k%]!<%HHV9f(B $BBh;M0z?t(B - PCP$B%f!<%6L>(B $BBh8^0z?t(B - PCP$B%Q%9%o!<%I(B + + $B%*%W%7%g%s0z?t$H$7$F!$(B-d$B$,$"$j$^$9!%(B-d$B$,;XDj$5$l$k$H%G%P%C%0>pJs$r=PNO$7$^$9!%(B </pre> <p> PCP$B%f!<%6L>$H%Q%9%o!<%I$O(B ./configure $B;~$K(B --prefix $B$G;XDj$7$?(B @@ -2561,6 +2537,79 @@ pgpool-II$B$N%A%e!<%H%j%"%k$O(B<a href="tutorial-ja.html">$B$3$3(B<a/>$B$K$ <h1>$B%j%j!<%9%N!<%H(B<a name="release"></a></h1> +<h2>2.2 (urukiboshi) 2009/2/?</h2> +<h3>$B35MW(B</h3> +<p> +$B$3$N%P!<%8%g%s$G$O!$(BSERIAL$B%G!<%?$N07$$$H%*%s%i%$%s%j%+%P%j$K2~NI$,9T$J$o$l$F$$$^$9!%(B +$B$^$?!$%H%i%s%6%/%7%g%sJ,N%%l%Y%k$,%7%j%"%i%$%6%V%k$N>l9g$K!$(BDB$B%N!<%I4V$G%G!<%?$N0l4S@-$,$J$/$J$k2DG=@-$,$"$kLdBj!$%/%(%j$N%-%c%s%;%k$,$G$-$J$$LdBj$,=$@5$5$l$^$7$?!%(B +</p> + +<h3>$B?75!G=(B</h3> +<p> +<ul> +<li>insert_lock$B$,M-8z$J>l9g!$(BSERIAL$B7?$r;}$D%F!<%V%k$@$1$,%m%C%/$5$l$k$h$&$K$J$j$^$7$?(B(Tatsuo)$B!%(B +<li>$B@_Dj9`L\(Bclient_idle_limit_in_recovery$B$,DI2C$5$l$^$7$?!%(B + $B%*%s%i%$%s%j%+%P%j$NBh(B2$B%9%F!<%8$G%/%i%$%"%s%H$,%"%$%I%k$N$^$^5o:B$k$3$H$K$h$C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B + $B$9$Y$F$N(BDB$B%N!<%I$N%H%i%s%6%/%7%g%s$r%"%\!<%H$9$k$h$&$K$7$^$7$?!%(B + $B$3$&$7$J$$$H!$(BDB$B%N!<%I$N4V$G%G!<%?$NIT@09g$,5/$-$k$3$H$,$"$j$^$9(B(Tatsuo)$B!%(B + $BNc$r<($7$^$9(B(M$B$O%^%9%?!$(BS$B$O%9%l!<%V$r<($7$^$9(B)$B!%(B + <pre> + M:S1:BEGIN; + M:S2:BEGIN; + S:S1:BEGIN; + S:S2:BEGIN; + M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + M:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + S:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + M:S1:UPDATE t1 SET i = i + 1; + S:S1:UPDATE t1 SET i = i + 1; + M:S2:UPDATE t1 SET i = i + 1; <-- blocked + S:S1:COMMIT; + M:S1:COMMIT; + M:S2:ERROR: could not serialize access due to concurrent update + S:S2:UPDATE t1 SET i = i + 1; <-- success in UPDATE and data becomes inconsistent! + </pre> + + <li> raw$B%b!<%I$G(BMD5$BG'>Z$,;H$($k$h$&$K$7$^$7$?!%%I%-%e%a%s%H>e$G$O;H$($k$O$:$G$7$?(B(Tatsuo)$B!%(B + + <li> "SET TRANSACTION ISOLATION LEVEL must be called before any query"$B$N(B + $B%(%i!<$,H/@8$7$?>l9g$K(B"kind mimatch"$B%(%i!<$K$J$k$3$H$rKI$0$h$&$K$7$^$7$?(B(Tatsuo)$B!%(B + $B0J2<$N%7%J%j%*$GLdBj$,H/@8$7$^$9!%(B + <pre> + M:S1:BEGIN; + S:S1:BEGIN; + M:S1:SELECT 1; <-- only sent to MASTER + M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + M: <-- error + S: <-- ok since no previous SELECT is sent. kind mismatch error occurs! + </pre> +</ul> + <h2>2.1 (inamiboshi) 2008/7/25</h2> <h3>$B?75!G=(B</h3> <ul> diff --git a/version.h b/version.h index b543c58f6..4fa8ca73f 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define PGPOOLVERSION "inamiboshi" +#define PGPOOLVERSION "urukiboshi" [parent: 9c298510eced]