pgpool2.git / summary / log / commit / refs
commit 4d38578ebe257353ba42ef5d09eac61ca7b75b15
Author: Yoshiyuki Asaba <y-asaba at pgfoundry.org>
Date: Tue Feb 12 11:16:10 2008 +0000
Remove "replication_timeout" parameter.
This parameter was enabled if replication_strict = false. However
replication_strict was already removed.
child.c | 7 -------
doc/pgpool-en.html | 10 +---------
doc/pgpool-ja.html | 12 +-----------
pgpool.conf.sample | 4 ----
pool.h | 13 +------------
pool_config.c | 14 --------------
pool_config.l | 14 --------------
pool_process_query.c | 50 ++++----------------------------------------------
pool_stream.c | 24 ++++--------------------
9 files changed, 11 insertions(+), 137 deletions(-)
diff --git a/child.c b/child.c
index 7ddf61455..0460778f8 100644
--- a/child.c
+++ b/child.c
@@ -212,9 +212,6 @@ void do_child(int unix_fd, int inet_fd)
backend_timer_expired = 0;
}
- /* disable timeout */
- pool_disable_timeout();
-
/* read the startup packet */
retry_startup:
sp = read_startup_packet(frontend);
@@ -406,10 +403,6 @@ void do_child(int unix_fd, int inet_fd)
}
- /* enable query result read timeout if non strict mode */
- if (pool_config->replication_strict == 0)
- pool_enable_timeout();
-
connected = 1;
/* show ps status */
diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html
index 70e5f77a3..6fb90ef8f 100644
--- a/doc/pgpool-en.html
+++ b/doc/pgpool-en.html
@@ -702,13 +702,6 @@ configuration parameters below must be set in addtion to everything above.</p>
is false.</p>
</dd>
- <dt>replication_timeout</dt>
- <dd>
- <p>Specifies the timeout value in milliseconds, for detecting
- deadlocks. Default is 5000 (5 seconds), and 0 means no
- timeout.</p>
- </dd>
-
<dt>load_balance_mode</dt>
<dd>
<p>When set to true, SELECT queries will be
@@ -1578,8 +1571,7 @@ B) SELECT * FROM tellers WHERE tid = 11 FOR UPDATE;
<p>
In the case above, a single node cannot detect the deadlock, so
pgpool-II will still wait for the response. This phenomenon
-occurs with other queries that acquire row level locks. To avoid this
-problem, set <code>replication_timeout</code>.</p>
+occurs with other queries that acquire row level locks.
</p>
<p>Also, if a deadlock occurs in one node, transaction states in each
node will not be consistent. Therefore, pgpool-II terminates the
diff --git a/doc/pgpool-ja.html b/doc/pgpool-ja.html
index 8b32ea030..cc249c00e 100644
--- a/doc/pgpool-ja.html
+++ b/doc/pgpool-ja.html
@@ -721,15 +721,6 @@ 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_timeout
-<dd>
-<p>
- $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>
-
<dt>load_balance_mode
<dd>
<p>
@@ -1791,8 +1782,7 @@ pgpool_catalog.dist_def$B%F!<%V%k$K(BVIEW$B$rEPO?$7$F$*$-$^$9!#(B
<p>
$B$3$N>l9g!"C10l$N%N!<%I$G$O%G%C%I%m%C%/$r8!CN$G$-$J$$$?$a!"(Bpgpool $B$OBT(B
$B$?$5$l$?>uBV$K$J$j$^$9!#$3$N8=>]$O(B SELECT FOR UPDATE $B0J30$K$b9T%m%C%/(B
-$B$r3MF@$9$k%/%(%j$GH/@8$9$k2DG=@-$,$"$j$^$9!#2sHr:v$H$7$^$7$F$O!"(B
-replication_timeout $B$r@_Dj$9$k$h$&$K$7$F$/$@$5$$!#(B
+$B$r3MF@$9$k%/%(%j$GH/@8$9$k2DG=@-$,$"$j$^$9!#(B
</p>
<p>
$B$^$?!"$"$k%N!<%I$G%G%C%I%m%C%/$,H/@8$7$?>l9g$O!"3F%N!<%I$N%H%i%s%6%/%7%g(B
diff --git a/pgpool.conf.sample b/pgpool.conf.sample
index 9ac3f8323..1300b71f6 100644
--- a/pgpool.conf.sample
+++ b/pgpool.conf.sample
@@ -59,10 +59,6 @@ logdir = '/tmp'
# Replication mode
replication_mode = false
-# 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
# are load balanced. This is ignored if replication_mode is false.
load_balance_mode = false
diff --git a/pool.h b/pool.h
index 3dcbd99fd..6739b8652 100644
--- a/pool.h
+++ b/pool.h
@@ -135,20 +135,11 @@ typedef struct {
char *logdir; /* logging directory */
char *backend_socket_dir; /* Unix domain socket directory for the PostgreSQL server */
int replication_mode; /* replication mode */
- int replication_strict; /* if non 0, wait for completion of the
- query sent to master to avoid deadlock */
int log_connections; /* 0:false, 1:true - logs incoming connections */
int log_hostname; /* 0:false, 1:true - resolve hostname */
int enable_pool_hba; /* 0:false, 1:true - enables pool_hba.conf file authentication */
- /*
- * if next PostgreSQL server does not respond in this milli
- * seconds, abort this session. this is not compatible with
- * replication_strict = 1. 0 means no timeout.
- */
- int replication_timeout;
-
int load_balance_mode; /* load balance mode */
int replication_stop_on_mismatch; /* if there's a data mismatch between master and secondary
@@ -462,9 +453,7 @@ extern int connect_unix_domain_socket(int secondary_backend);
extern int connect_inet_domain_socket_by_port(char *host, int port);
extern int connect_unix_domain_socket_by_port(int port, char *socket_dir);
-extern int pool_check_fd(POOL_CONNECTION *cp, int notimeout);
-extern void pool_enable_timeout(void);
-extern void pool_disable_timeout(void);
+extern int pool_check_fd(POOL_CONNECTION *cp);
extern void pool_send_frontend_exits(POOL_CONNECTION_POOL *backend);
diff --git a/pool_config.c b/pool_config.c
index 49af79aaf..0425da164 100644
--- a/pool_config.c
+++ b/pool_config.c
@@ -1830,7 +1830,6 @@ int pool_init_config(void)
pool_config->enable_pool_hba = 0;
pool_config->replication_mode = 0;
- pool_config->replication_timeout = 0;
pool_config->load_balance_mode = 0;
pool_config->replication_stop_on_mismatch = 0;
pool_config->replicate_select = 0;
@@ -2220,19 +2219,6 @@ int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context)
}
}
- else if (!strcmp(key, "replication_timeout") &&
- CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context))
- {
- int v = atoi(yytext);
-
- if (token != POOL_INTEGER || v < 0)
- {
- pool_error("pool_config: %s must be greater or equal to 0 numeric value", key);
- fclose(fd);
- return(-1);
- }
- pool_config->replication_timeout = v;
- }
else if (!strcmp(key, "load_balance_mode") && CHECK_CONTEXT(INIT_CONFIG, context))
{
int v = eval_logical(yytext);
diff --git a/pool_config.l b/pool_config.l
index d327e0595..3428cbd0a 100644
--- a/pool_config.l
+++ b/pool_config.l
@@ -142,7 +142,6 @@ int pool_init_config(void)
pool_config->enable_pool_hba = 0;
pool_config->replication_mode = 0;
- pool_config->replication_timeout = 0;
pool_config->load_balance_mode = 0;
pool_config->replication_stop_on_mismatch = 0;
pool_config->replicate_select = 0;
@@ -532,19 +531,6 @@ int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context)
}
}
- else if (!strcmp(key, "replication_timeout") &&
- CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context))
- {
- int v = atoi(yytext);
-
- if (token != POOL_INTEGER || v < 0)
- {
- pool_error("pool_config: %s must be greater or equal to 0 numeric value", key);
- fclose(fd);
- return(-1);
- }
- pool_config->replication_timeout = v;
- }
else if (!strcmp(key, "load_balance_mode") && CHECK_CONTEXT(INIT_CONFIG, context))
{
int v = eval_logical(yytext);
diff --git a/pool_process_query.c b/pool_process_query.c
index 6feab2df7..f9992be9a 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -3000,44 +3000,24 @@ static POOL_STATUS ProcessFrontendResponse(POOL_CONNECTION *frontend,
return status;
}
-static int timeoutmsec;
-
-/*
- * enable read timeout
- */
-void pool_enable_timeout()
-{
- timeoutmsec = pool_config->replication_timeout;
-}
-
-/*
- * disable read timeout
- */
-void pool_disable_timeout()
-{
- timeoutmsec = 0;
-}
-
/*
* wait until read data is ready
*/
static int synchronize(POOL_CONNECTION *cp)
{
- return pool_check_fd(cp, 1);
+ return pool_check_fd(cp);
}
/*
* wait until read data is ready
* if notimeout is non 0, wait forever.
*/
-int pool_check_fd(POOL_CONNECTION *cp, int notimeout)
+int pool_check_fd(POOL_CONNECTION *cp)
{
fd_set readmask;
fd_set exceptmask;
int fd;
int fds;
- struct timeval timeout;
- struct timeval *tp;
fd = cp->fd;
@@ -3048,17 +3028,8 @@ int pool_check_fd(POOL_CONNECTION *cp, int notimeout)
FD_SET(fd, &readmask);
FD_SET(fd, &exceptmask);
- if (notimeout || timeoutmsec == 0)
- tp = NULL;
- else
- {
- timeout.tv_sec = pool_config->replication_timeout / 1000;
- timeout.tv_usec = (pool_config->replication_timeout - (timeout.tv_sec * 1000))*1000;
- tp = &timeout;
- }
-
- fds = select(fd+1, &readmask, NULL, &exceptmask, tp);
-
+ /* no timeout */
+ fds = select(fd+1, &readmask, NULL, &exceptmask, NULL);
if (fds == -1)
{
if (errno == EAGAIN || errno == EINTR)
@@ -3073,14 +3044,6 @@ int pool_check_fd(POOL_CONNECTION *cp, int notimeout)
pool_error("pool_check_fd: exception occurred");
break;
}
-
- if (fds == 0)
- {
- pool_error("pool_check_fd: data is not ready tp->tv_sec %d tp->tp_usec %d",
- pool_config->replication_timeout / 1000,
- (pool_config->replication_timeout - (timeout.tv_sec * 1000))*1000);
- break;
- }
return 0;
}
return -1;
@@ -3191,11 +3154,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_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);
- i++;
-
strncpy(status[i].name, "load_balance_mode", POOLCONFIG_MAXNAMELEN);
snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->load_balance_mode);
strncpy(status[i].desc, "non 0 if operating in load balancing mode", POOLCONFIG_MAXDESCLEN);
diff --git a/pool_stream.c b/pool_stream.c
index dd71d6d8e..c7592cf5e 100644
--- a/pool_stream.c
+++ b/pool_stream.c
@@ -116,18 +116,14 @@ int pool_read(POOL_CONNECTION *cp, void *buf, int len)
int consume_size;
int readlen;
- int notimeout;
consume_size = consume_pending_data(cp, buf, len);
len -= consume_size;
buf += consume_size;
- /* if this is not the master backend, then set timeout */
- notimeout = !IS_MASTER_NODE_ID(cp->db_node_id);
-
while (len > 0)
{
- if (pool_check_fd(cp, notimeout))
+ if (pool_check_fd(cp))
{
if (!IS_MASTER_NODE_ID(cp->db_node_id))
{
@@ -214,18 +210,14 @@ int pool_read_parallel(POOL_CONNECTION *cp, void *buf, int len)
int consume_size;
int readlen;
- int notimeout;
consume_size = consume_pending_data(cp, buf, len);
len -= consume_size;
buf += consume_size;
- /* if this is not the master backend, then set timeout */
- notimeout = 1;
-
while (len > 0)
{
- if (pool_check_fd(cp, notimeout))
+ if (pool_check_fd(cp))
{
if (!IS_MASTER_NODE_ID(cp->db_node_id))
{
@@ -312,7 +304,6 @@ char *pool_read2(POOL_CONNECTION *cp, int len)
int alloc_size;
int consume_size;
int readlen;
- int notimeout;
req_size = cp->len + len;
@@ -334,12 +325,9 @@ char *pool_read2(POOL_CONNECTION *cp, int len)
len -= consume_size;
buf += consume_size;
- /* if this is not the master backend, then set timeout */
- notimeout = !IS_MASTER_NODE_ID(cp->db_node_id);
-
while (len > 0)
{
- if (pool_check_fd(cp, notimeout))
+ if (pool_check_fd(cp))
{
if (!IS_MASTER_NODE_ID(cp->db_node_id))
{
@@ -587,7 +575,6 @@ char *pool_read_string(POOL_CONNECTION *cp, int *len, int line)
int strlength;
int flag;
int consume_size;
- int notimeout;
#ifdef DEBUG
static char pbuf[READBUFSZ];
@@ -654,12 +641,9 @@ char *pool_read_string(POOL_CONNECTION *cp, int *len, int line)
readsize = cp->sbufsz;
}
- /* if this is not the master backend, then set timeout */
- notimeout = !IS_MASTER_NODE_ID(cp->db_node_id);
-
for (;;)
{
- if (pool_check_fd(cp, notimeout))
+ if (pool_check_fd(cp))
{
if (!IS_MASTER_NODE_ID(cp->db_node_id))
{
[parent: 180c57936c49]