pgpool2.git / summary / log / commit / refs

commit    d29871a844fa5b747c1e2ced03fc2bbb9e88fe6e
Author:   Yoshiyuki Asaba <y-asaba at pgfoundry.org>
Date:     Wed Oct 31 10:45:52 2007 +0000

    Remove replicate_strict derective. pgpool-II 2.x always set to true.


NEWS | 2 + doc/pgpool-en.html | 12 +----- doc/pgpool-ja.html | 20 +++------- pgpool.conf.sample | 11 +----- pool.h | 6 --- pool_config.l | 13 ------- pool_process_query.c | 102 ++++++++++++++++----------------------------------- 7 files changed, 42 insertions(+), 124 deletions(-) diff --git a/NEWS b/NEWS index c42ad03fe..01af63b22 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ * Incompatibility since pgpool-II 1.x - the default value for ignore_leading_white_space is now true(Yoshiyuki) + - replicate_strict is removed. The value is always + true(Yoshiyuki) * General - Allow to reload pgpool.conf(Yoshiyuki) diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html index 15bf2bd59..c60f9999e 100644 --- a/doc/pgpool-en.html +++ b/doc/pgpool-en.html @@ -573,20 +573,10 @@ configuration parameters below must be set in addtion to everything above.</p> is false.</p> </dd> - <dt>replication_strict</dt> - <dd> - <p>When set to true, pgpool-II waits for the Master - DB for all queries to be processed before moving on to the next - backend. This option eliminates the risk of deadlocks, but the - performance may degrade due to the lack of a - parallelism. Default value is true.</p> - </dd> - <dt>replication_timeout</dt> <dd> <p>Specifies the timeout value in milliseconds, for detecting - deadlocks while <code>replication_strict</code> is - false. Default is 5000 (5 seconds), and 0 means no + deadlocks. Default is 5000 (5 seconds), and 0 means no timeout.</p> </dd> diff --git a/doc/pgpool-ja.html b/doc/pgpool-ja.html index 72838e3b2..61ad27bc6 100644 --- a/doc/pgpool-ja.html +++ b/doc/pgpool-ja.html @@ -708,24 +708,12 @@ raw$B%b!<%I!$%3%M%/%7%g%s%W!<%k%b!<%I$K2C$(!$0J2<$r@_Dj$7$^$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>replication_strict -<dd> -<p> - $B$3$N%*%W%7%g%s$r(Btrue$B$K$9$k$H!$%^%9%?!<(BDB$B$NLd$$9g$o$;=hM}$N40N;$rBT$C$F(B - $B$+$i<!$N(BDB$B%N!<%I$N=hM}$K0\$j$^$9!%%G%C%I%m%C%/$N4m81@-$O$J$/$J$j$^$9$,!$(B - DB$B%N!<%I$N4V$GLd$$9g$o$;$NJBNs=hM}$r9T$o$J$/$J$k$N$G@-G=$,(B - $BDc2<$9$k>l9g$b$"$j$^$9!%(B - - $B$3$N%*%W%7%g%s$N%G%U%)%k%HCM$O(Btrue$B$G$9!%(B -$B$3$N%Q%i%a!<%?$rJQ99$7$?;~$K$O@_Dj%U%!%$%k$r:FFI$_9~$_$7$F$/$@$5$$!#(B -<p> - <dt>replication_timeout <dd> <p> - replication_strict$B$,(Bfalse$B$N$H$-$K%G%C%I%m%C%/$r4F;k$9$k$?$a$N%?%$%`(B - $B%"%&%H;~4V$r%_%jICC10L$G;XDj$7$^$9!%%G%U%)%k%HCM$O(B5000$B!$$9$J$o$A(B5$BIC(B - $B$G$9!%(B0$B$r;XDj$9$k$H%?%$%`%"%&%H$7$J$/$J$j$^$9!%(B + $B%G%C%I%m%C%/$r4F;k$9$k$?$a$N%?%$%`%"%&%H;~4V$r%_%jICC10L$G;XDj$7$^(B + $B$9!%%G%U%)%k%HCM$O(B5000$B!$$9$J$o$A(B5$BIC$G$9!%(B0$B$r;XDj$9$k$H%?%$%`%"%&%H(B + $B$7$J$/$J$j$^$9!%(B $B$3$N%Q%i%a!<%?$rJQ99$7$?;~$K$O@_Dj%U%!%$%k$r:FFI$_9~$_$7$F$/$@$5$$!#(B </p> @@ -2357,6 +2345,8 @@ count(*) $B$r;H$C$?%/%(%j$O!"0J2<$N$h$&$K=q$-49$($,9T$o$l$^$9!#(B <ul> <li> ignore_leading_white_space $B$N%G%U%)%k%HCM$r(B true $B$K$7$^$7$?!#(B (Yoshiyuki) + <li> replicate_strict $B$rGQ;_$7$^$7$?!#>o$K(B replicate_strict $B$,(B true + $B$N5sF0$K$J$j$^$9!#(B(Yoshiyuki) </ul> <h3>$BA4HL(B</h3> diff --git a/pgpool.conf.sample b/pgpool.conf.sample index 4c28cbf2b..7ee499319 100644 --- a/pgpool.conf.sample +++ b/pgpool.conf.sample @@ -59,15 +59,8 @@ logdir = '/tmp' # Replication mode replication_mode = false -# Set this to true if you want to avoid deadlock situations when -# replication is enabled. There will, however, be a noticable performance -# degradation. A workaround is to set this to false and insert a /*STRICT*/ -# comment at the beginning of the SQL command. -replication_strict = true - -# When replication_strict is set to false, there will be a chance for -# deadlocks. Set this to nonzero (in milliseconds) to detect this -# situation and resolve the deadlock by aborting current session. +# Set this to nonzero (in milliseconds) to detect this situation and +# resolve the deadlock by aborting current session. replication_timeout = 5000 # Load balancing mode, i.e., all SELECTs except in a transaction block diff --git a/pool.h b/pool.h index 386159ab4..3d2ab7419 100644 --- a/pool.h +++ b/pool.h @@ -57,12 +57,6 @@ /* pid file name */ #define PID_FILE_NAME "pgpool.pid" -/* strict mode comment in SQL */ -#define STRICT_MODE_STR "/*STRICT*/" -#define STRICT_MODE(s) (strncasecmp((s), STRICT_MODE_STR, strlen(STRICT_MODE_STR)) == 0) -#define NO_STRICT_MODE_STR "/*NO STRICT*/" -#define NO_STRICT_MODE(s) (strncasecmp((s), NO_STRICT_MODE_STR, strlen(NO_STRICT_MODE_STR)) == 0) - typedef enum { POOL_CONTINUE = 0, POOL_IDLE, diff --git a/pool_config.l b/pool_config.l index 0eae51176..b9cd4b996 100644 --- a/pool_config.l +++ b/pool_config.l @@ -141,7 +141,6 @@ int pool_init_config(void) pool_config->enable_pool_hba = 0; pool_config->replication_mode = 0; - pool_config->replication_strict = 1; pool_config->replication_timeout = 0; pool_config->load_balance_mode = 0; pool_config->replication_stop_on_mismatch = 0; @@ -531,18 +530,6 @@ int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context) } } - else if (!strcmp(key, "replication_strict") && CHECK_CONTEXT(INIT_CONFIG, context)) - { - int v = eval_logical(yytext); - - if (v < 0) - { - pool_error("pool_config: invalid value %s for %s", yytext, key); - fclose(fd); - return(-1); - } - pool_config->replication_strict = v; - } else if (!strcmp(key, "replication_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { diff --git a/pool_process_query.c b/pool_process_query.c index 73358f4e5..d5fe2e4b8 100644 --- a/pool_process_query.c +++ b/pool_process_query.c @@ -666,9 +666,7 @@ POOL_STATUS pool_parallel_exec(POOL_CONNECTION *frontend, * in "strict mode" we need to wait for backend completing the query. * note that this is not applied if "NO STRICT" is specified as a comment. */ - if ((pool_config->replication_strict && - !NO_STRICT_MODE(string) && is_strict_query(node)) || - STRICT_MODE(string)) + if (is_strict_query(node)) { pool_debug("waiting for backend %d completing the query", i); if (synchronize(CONNECTION(backend, i))) @@ -1290,16 +1288,11 @@ static POOL_STATUS send_simplequery_message(POOL_CONNECTION *backend, int len, c static POOL_STATUS wait_for_query_response(POOL_CONNECTION *backend, char *string) { /* - * in "strict mode" we need to wait for backend completing the query. - * note that this is not applied if "NO STRICT" is specified as a comment. + * we need to wait for backend completing the query. */ - if ((pool_config->replication_strict && !NO_STRICT_MODE(string)) || - STRICT_MODE(string)) - { - pool_debug("waiting for backend %d completing the query", backend->db_node_id); - if (synchronize(backend)) - return POOL_END; - } + pool_debug("waiting for backend %d completing the query", backend->db_node_id); + if (synchronize(backend)) + return POOL_END; return POOL_CONTINUE; } @@ -1396,12 +1389,9 @@ static POOL_STATUS Execute(POOL_CONNECTION *frontend, if (send_execute_message(backend, MASTER_NODE_ID, len, string) != POOL_CONTINUE) return POOL_END; - if (pool_config->replication_strict) - { - pool_debug("waiting for backend completing the query"); - if (synchronize(CONNECTION(backend, MASTER_NODE_ID))) - return POOL_END; - } + pool_debug("waiting for backend completing the query"); + if (synchronize(CONNECTION(backend, MASTER_NODE_ID))) + return POOL_END; /* * We must check deadlock error because a aborted transaction @@ -1437,12 +1427,9 @@ static POOL_STATUS Execute(POOL_CONNECTION *frontend, if (!VALID_BACKEND(i) || IS_MASTER_NODE_ID(i)) continue; - if (pool_config->replication_strict) - { - pool_debug("waiting for backend completing the query"); - if (synchronize(CONNECTION(backend, i))) - return POOL_END; - } + pool_debug("waiting for backend completing the query"); + if (synchronize(CONNECTION(backend, i))) + return POOL_END; } if (commit) @@ -1450,12 +1437,9 @@ static POOL_STATUS Execute(POOL_CONNECTION *frontend, if (send_execute_message(backend, MASTER_NODE_ID, len, string) != POOL_CONTINUE) return POOL_END; - if (pool_config->replication_strict) - { - pool_debug("waiting for backend completing the query"); - if (synchronize(MASTER(backend))) - return POOL_END; - } + pool_debug("waiting for backend completing the query"); + if (synchronize(MASTER(backend))) + return POOL_END; } } else @@ -1463,12 +1447,9 @@ static POOL_STATUS Execute(POOL_CONNECTION *frontend, if (send_execute_message(backend, MASTER_NODE_ID, len, string) != POOL_CONTINUE) return POOL_END; - if (pool_config->replication_strict) - { - pool_debug("waiting for backend completing the query"); - if (synchronize(CONNECTION(backend, MASTER_NODE_ID))) - return POOL_END; - } + pool_debug("waiting for backend completing the query"); + if (synchronize(CONNECTION(backend, MASTER_NODE_ID))) + return POOL_END; } while ((ret = read_kind_from_backend(frontend, backend, &kind)) == POOL_CONTINUE) @@ -1642,12 +1623,9 @@ static POOL_STATUS Parse(POOL_CONNECTION *frontend, /* We must synchronize because Parse message acquires table * locks. */ - if (pool_config->replication_strict) - { - pool_debug("waiting for master completing the query"); - if (synchronize(MASTER(backend))) - return POOL_END; - } + pool_debug("waiting for master completing the query"); + if (synchronize(MASTER(backend))) + return POOL_END; /* * We must check deadlock error because a aborted transaction @@ -1683,12 +1661,9 @@ static POOL_STATUS Parse(POOL_CONNECTION *frontend, if (!VALID_BACKEND(i) || IS_MASTER_NODE_ID(i)) continue; - if (pool_config->replication_strict) - { - pool_debug("waiting for backend completing the query"); - if (synchronize(CONNECTION(backend, i))) - return POOL_END; - } + pool_debug("waiting for backend completing the query"); + if (synchronize(CONNECTION(backend, i))) + return POOL_END; } } @@ -1741,15 +1716,11 @@ static POOL_STATUS Sync(POOL_CONNECTION *frontend, if (REPLICATION) { /* - * in "strict mode" we need to wait for master completing the query. - * note that this is not applied if "NO STRICT" is specified as a comment. + * we need to wait for master completing the query. */ - if (pool_config->replication_strict) - { - pool_debug("waiting for master completing the query"); - if (synchronize(MASTER(backend))) - return POOL_END; - } + pool_debug("waiting for master completing the query"); + if (synchronize(MASTER(backend))) + return POOL_END; pool_write(SECONDARY(backend), "S", 1); sendlen = htonl(len + 4); @@ -1759,10 +1730,9 @@ static POOL_STATUS Sync(POOL_CONNECTION *frontend, return POOL_END; } - /* in "strict mode" we need to wait for secondary completing the query */ - if (pool_config->replication_strict) - if (synchronize(SECONDARY(backend))) - return POOL_END; + /* we need to wait for secondary completing the query */ + if (synchronize(SECONDARY(backend))) + return POOL_END; } return POOL_CONTINUE; } @@ -2639,11 +2609,8 @@ static POOL_STATUS CopyDataRows(POOL_CONNECTION *frontend, if (pool_flush(CONNECTION(backend, i)) <0) return POOL_END; - if (pool_config->replication_strict) - { - if (synchronize(CONNECTION(backend, i))) - return POOL_END; - } + if (synchronize(CONNECTION(backend, i))) + return POOL_END; } } } @@ -3137,11 +3104,6 @@ static void process_reporting(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *b strncpy(status[i].desc, "non 0 if operating in replication mode", POOLCONFIG_MAXDESCLEN); i++; - strncpy(status[i].name, "replication_strict", POOLCONFIG_MAXNAMELEN); - snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->replication_strict); - strncpy(status[i].desc, "non 0 if operating in strict mode", POOLCONFIG_MAXDESCLEN); - i++; - strncpy(status[i].name, "replication_timeout", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->replication_timeout); strncpy(status[i].desc, "if secondary does not respond in this milli seconds, abort the session", POOLCONFIG_MAXDESCLEN); [parent: ff64cc5a51bb]