summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarko Kreen2007-11-19 09:13:53 +0000
committerMarko Kreen2007-11-19 09:13:53 +0000
commite701290ff5c03c5f0addb44f9b78dd1f941f9299 (patch)
tree20ec0c5d877908a213d18df845cc19806c20128b /src
parenta5e9098653672bbeaec78c4d23f2c398e77f8b52 (diff)
Remote 'statement_timeout' config parameter.
It did not work in 2.0.2 and although it works now, it could not work in live env as the SET cannot be combined with main request, thus likely it will be executed on different backend.
Diffstat (limited to 'src')
-rw-r--r--src/cluster.c6
-rw-r--r--src/execute.c10
-rw-r--r--src/plproxy.h1
3 files changed, 1 insertions, 16 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 33ec9b9..0379611 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -259,7 +259,7 @@ get_config(ProxyCluster *cluster, Datum dname, ProxyFunction *func)
plproxy_error(func, "val must not be NULL");
if (strcasecmp(key, "statement_timeout") == 0)
- cf->statement_timeout = atoi(val);
+ /* ignore */ ;
else if (strcasecmp("connection_lifetime", key) == 0)
cf->connection_lifetime = atoi(val);
else if (strcasecmp("query_timeout", key) == 0)
@@ -340,8 +340,6 @@ new_cluster(const char *name)
cluster = palloc0(sizeof(*cluster));
cluster->name = pstrdup(name);
- cluster->config.statement_timeout = -1;
-
MemoryContextSwitchTo(old_ctx);
return cluster;
@@ -385,8 +383,6 @@ fake_cluster(ProxyFunction *func)
conn->connstr = pstrdup(cluster->name);
conn->state = C_NONE;
- cluster->config.statement_timeout = -1;
-
MemoryContextSwitchTo(old_ctx);
cluster->next = fake_cluster_list;
diff --git a/src/execute.c b/src/execute.c
index a0d018e..338b6e3 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -95,7 +95,6 @@ flush_connection(ProxyFunction *func, ProxyConnection *conn)
static int
tune_connection(ProxyFunction *func, ProxyConnection *conn)
{
- ProxyConfig *cf = &func->cur_cluster->config;
const char *this_enc, *dst_enc;
const char *dst_ver;
StringInfo sql = NULL;
@@ -128,15 +127,6 @@ tune_connection(ProxyFunction *func, ProxyConnection *conn)
conn_error(func, conn, sql->data);
}
- /* add statement_timeout to query */
- if (cf->statement_timeout >= 0 && !conn->tuning)
- {
- if (!sql)
- sql = makeStringInfo();
- appendStringInfo(sql, "set statement_timeout = %d; ",
- cf->statement_timeout);
- }
-
/*
* send tuning query
*/
diff --git a/src/plproxy.h b/src/plproxy.h
index 4e5d51e..96b734a 100644
--- a/src/plproxy.h
+++ b/src/plproxy.h
@@ -101,7 +101,6 @@ typedef struct ProxyConfig
int connect_timeout; /* How long connect may take (secs) */
int query_timeout; /* How long query may take (secs) */
int connection_lifetime; /* How long the connection may live (secs) */
- int statement_timeout; /* Do remotely: SET statement_timeout */
int disable_binary; /* Avoid binary I/O */
} ProxyConfig;