pgpool2.git / summary / log / commit / refs
commit d94186f1dbb708d9cfbf413d1835c3f00f9c3889
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Tue Jul 24 08:43:16 2012 +0000
Fix pool_get_database_oid. Relcache is not neede to be session local.
Fix pool_search_relcache. When cache is session local and discard
local cache entry because local session id is not my own, set refcnt
to 0. Otherwise, false alarm "pool_search_relcache: cache replacement
happend" is showed. Problem reported in [pgpool-general: 792].
pool_memqcache.c | 2 +-
pool_relcache.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/pool_memqcache.c b/pool_memqcache.c
index f7a6f66d2..5ac83a8b1 100644
--- a/pool_memqcache.c
+++ b/pool_memqcache.c
@@ -1082,7 +1082,7 @@ static int pool_get_database_oid(void)
{
relcache = pool_create_relcache(pool_config->relcache_size, DATABASE_TO_OID_QUERY,
int_register_func, int_unregister_func,
- true);
+ false);
if (relcache == NULL)
{
pool_error("pool_get_database_oid: pool_create_relcache error");
diff --git a/pool_relcache.c b/pool_relcache.c
index d03c0e48a..d7427f767 100644
--- a/pool_relcache.c
+++ b/pool_relcache.c
@@ -190,6 +190,7 @@ void *pool_search_relcache(POOL_RELCACHE *relcache, POOL_CONNECTION_POOL *backen
if (relcache->cache[i].session_id != local_session_id)
{
index = i;
+ relcache->cache[i].refcnt = 0;
break;
}
}
[parent: f82c27735a40]