pgpool2.git / summary / log / commit / refs
commit 7e553046c7581fc80a969b38e77f175f27b60f61
Author: Yugo Nagata <nagata@sraoss.co.jp>
Date: Tue Apr 24 07:00:59 2012 +0000
Fix SimpleQUery() not to use on memory query cache if we are
in aborted transaction.
pool_proto_modules.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pool_proto_modules.c b/pool_proto_modules.c
index e8a6cb526..de1452d83 100644
--- a/pool_proto_modules.c
+++ b/pool_proto_modules.c
@@ -158,10 +158,13 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
* do not use cache. Of course we could analyze the SELECT to see
* if it uses the table modified in the transaction, but it will
* need parsing query and accessing to system catalog, which will
- * add significant overhead.
+ * add significant overhead. Moreover if we are in aborted
+ * transaction, commands should be ignored, so we should not use
+ * query cache.
*/
if (pool_config->memory_cache_enabled && is_likely_select &&
- !pool_is_writing_transaction())
+ !pool_is_writing_transaction() &&
+ TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != 'E')
{
bool foundp;
[parent: b0728f29177a]