pgpool2.git / summary / log / commit / refs
commit c9be86d2fdca8af8cc95676779d0607602c58a13
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Mon Mar 19 08:50:44 2012 +0000
Fix pool_add_table_oid_map() so that it does not read oid map file to
make sure that same md5 key has not been already registered. This is
not necessary because:
1) If the same key has been already registered, the data should be
taken from the cache.
2) Registering same keys is not harmful.
This change significantly enhances the performance.
pool_memqcache.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/pool_memqcache.c b/pool_memqcache.c
index 44716fc0a..8c6a3697f 100644
--- a/pool_memqcache.c
+++ b/pool_memqcache.c
@@ -995,7 +995,7 @@ static void pool_add_table_oid_map(POOL_CACHEKEY *cachekey, int num_table_oids,
{
if (errno != EEXIST)
{
- pool_error("pool_add_table_oid_map: failed to create %s", dir);
+ pool_error("pool_add_table_oid_map: failed to create %s. Reason:%s", dir, strerror(errno));
return;
}
}
@@ -1056,6 +1056,7 @@ static void pool_add_table_oid_map(POOL_CACHEKEY *cachekey, int num_table_oids,
return;
}
+#ifdef NOT_USED
for (;;)
{
sts = read(fd, (char *)&buf, len);
@@ -1087,6 +1088,15 @@ static void pool_add_table_oid_map(POOL_CACHEKEY *cachekey, int num_table_oids,
}
break;
}
+#endif
+
+ if (lseek(fd, 0, SEEK_END) == -1)
+ {
+ pool_error("pool_add_table_oid_map: failed to lseek %s. reason:%s",
+ path, strerror(errno));
+ close(fd);
+ return;
+ }
/*
* Write cache_id or cache key at the end of file
[parent: 9bb52268b16d]