summaryrefslogtreecommitdiff
path: root/storage/maria/unittest
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2014-07-19 17:46:08 +0300
committerMichael Widenius <monty@askmonty.org>2014-07-19 17:46:08 +0300
commitf0f2072d1fe2616a734e3d100f251516c3f2e0b2 (patch)
treee49597b4ef92d725a4ccf0c6e85deb9dd81825e7 /storage/maria/unittest
parentff205b25d543f87c8b79afc3ea0013017e751cd9 (diff)
downloadmariadb-git-f0f2072d1fe2616a734e3d100f251516c3f2e0b2.tar.gz
Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write
Reason for the problem was that the hash of changed files in the key cache was too small (was 128). Fixed by making the hash size larger and changeable. - Introduced key-cache-file-hash-size (default 512) for MyISAM and aria_pagecache_file_hash_size (default 512) for Aria. - Added new status variable "Feature_delay_key_write" which counts number of tables opened that are using delay_key_write mysql-test/r/features.result: Added test of Feature_delay_key_write mysql-test/r/key_cache.result: Updated tests as the number of blocks has changed mysql-test/r/mysqld--help.result: Updated result mysql-test/suite/maria/maria3.result: Updated result mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result: Test new variable mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test: Test new variable mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test: Test new variable mysql-test/t/features.test: Added test of Feature_delay_key_write mysql-test/t/key_cache.test: Updated tests as the number of blocks has changed mysys/mf_keycache.c: Made CHANGED_BLOCKS_HASH dynamic sql/handler.cc: Updated call to init_key_cache() sql/mysqld.cc: Added "Feature_delay_key_write" Added support for key-cache-file-hash-size sql/mysqld.h: Added support for key-cache-file-hash-size sql/sql_class.h: Added feature_files_opened_with_delayed_keys sql/sys_vars.cc: Added key_cache_file_hash_size storage/maria/ha_maria.cc: Added pagecache_file_hash_size Added counting of files with delay_key_write storage/maria/ma_checkpoint.c: Fixed compiler warning storage/maria/ma_pagecache.c: Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable storage/maria/ma_pagecache.h: Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable storage/maria/ma_rt_test.c: Updated parameters for init_pagecache() storage/maria/ma_test1.c: Updated parameters for init_pagecache() storage/maria/ma_test2.c: Updated parameters for init_pagecache() storage/maria/ma_test3.c: Updated parameters for init_pagecache() storage/maria/maria_chk.c: Updated parameters for init_pagecache() storage/maria/maria_ftdump.c: Updated parameters for init_pagecache() storage/maria/maria_pack.c: Updated parameters for init_pagecache() storage/maria/maria_read_log.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_consist.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_rwconsist.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_rwconsist2.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_single.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_first_lsn-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_max_lsn-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_multithread-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_noflush-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_nologs-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_pagecache-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_purge-t.c: Updated parameters for init_pagecache() storage/myisam/ha_myisam.cc: Added counting of files with delay_key_write storage/myisam/mi_check.c: Updated call to init_key_cache() storage/myisam/mi_test1.c: Updated call to init_key_cache() storage/myisam/mi_test2.c: Updated call to init_key_cache() storage/myisam/mi_test3.c: Updated call to init_key_cache() storage/myisam/mi_test_all.sh: Fixed broken test storage/myisam/myisam_ftdump.c: Updated call to init_key_cache() storage/myisam/myisamchk.c: Updated call to init_key_cache() storage/myisam/myisamlog.c: Updated call to init_key_cache()
Diffstat (limited to 'storage/maria/unittest')
-rw-r--r--storage/maria/unittest/ma_pagecache_consist.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist2.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_single.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_first_lsn-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_max_lsn-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multigroup-t.c9
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multithread-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_noflush-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_nologs-t.c9
-rw-r--r--storage/maria/unittest/ma_test_loghandler_pagecache-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_purge-t.c2
13 files changed, 25 insertions, 33 deletions
diff --git a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c
index 6a25a47591c..5f0e25b5bf4 100644
--- a/storage/maria/unittest/ma_pagecache_consist.c
+++ b/storage/maria/unittest/ma_pagecache_consist.c
@@ -431,7 +431,7 @@ int main(int argc __attribute__((unused)),
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TEST_PAGE_SIZE, 0)) == 0)
+ TEST_PAGE_SIZE, 0, 0)) == 0)
{
diag("Got error: init_pagecache() (errno: %d)\n",
errno);
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist.c b/storage/maria/unittest/ma_pagecache_rwconsist.c
index 7afdbfd0ac1..1a268db6ad5 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist.c
@@ -301,7 +301,7 @@ int main(int argc __attribute__((unused)),
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TEST_PAGE_SIZE, 0)) == 0)
+ TEST_PAGE_SIZE, 0, 0)) == 0)
{
diag("Got error: init_pagecache() (errno: %d)\n",
errno);
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist2.c b/storage/maria/unittest/ma_pagecache_rwconsist2.c
index 917fddd0bcf..751c045a879 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist2.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist2.c
@@ -297,7 +297,7 @@ int main(int argc __attribute__((unused)),
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TEST_PAGE_SIZE, 0)) == 0)
+ TEST_PAGE_SIZE, 0, 0)) == 0)
{
diag("Got error: init_pagecache() (errno: %d)\n",
errno);
diff --git a/storage/maria/unittest/ma_pagecache_single.c b/storage/maria/unittest/ma_pagecache_single.c
index 0031582589e..64f6782f20f 100644
--- a/storage/maria/unittest/ma_pagecache_single.c
+++ b/storage/maria/unittest/ma_pagecache_single.c
@@ -828,7 +828,7 @@ int main(int argc __attribute__((unused)),
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TEST_PAGE_SIZE, MYF(MY_WME))) == 0)
+ TEST_PAGE_SIZE, 0, MYF(MY_WME))) == 0)
{
fprintf(stderr,"Got error: init_pagecache() (errno: %d)\n",
errno);
diff --git a/storage/maria/unittest/ma_test_loghandler-t.c b/storage/maria/unittest/ma_test_loghandler-t.c
index abf2078ce8f..18650fa400d 100644
--- a/storage/maria/unittest/ma_test_loghandler-t.c
+++ b/storage/maria/unittest/ma_test_loghandler-t.c
@@ -147,7 +147,6 @@ int main(int argc __attribute__((unused)), char *argv[])
{
uint32 i;
uint32 rec_len;
- uint pagen;
uchar long_tr_id[6];
uchar lsn_buff[23]=
{
@@ -203,8 +202,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TRANSLOG_PAGE_SIZE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ TRANSLOG_PAGE_SIZE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
index 9ebd56c754c..cf86b59da45 100644
--- a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
@@ -35,7 +35,6 @@ static const char *default_dbug_option;
int main(int argc __attribute__((unused)), char *argv[])
{
- uint pagen;
uchar long_tr_id[6];
PAGECACHE pagecache;
LSN lsn, first_lsn, theor_lsn;
@@ -72,8 +71,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ PCACHE_PAGE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
index 4ae9def8598..855135451c3 100644
--- a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
@@ -36,7 +36,6 @@ static const char *default_dbug_option;
int main(int argc __attribute__((unused)), char *argv[])
{
ulong i;
- uint pagen;
uchar long_tr_id[6];
PAGECACHE pagecache;
LSN lsn, max_lsn, last_lsn= LSN_IMPOSSIBLE;
@@ -70,8 +69,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ PCACHE_PAGE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
index c8e63cb26ab..63d1f1c6977 100644
--- a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
@@ -226,7 +226,6 @@ int main(int argc __attribute__((unused)), char *argv[])
{
uint32 i;
uint32 rec_len;
- uint pagen;
uchar long_tr_id[6];
uchar lsn_buff[23]=
{
@@ -284,8 +283,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TRANSLOG_PAGE_SIZE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ TRANSLOG_PAGE_SIZE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
@@ -447,8 +446,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "pass2: Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TRANSLOG_PAGE_SIZE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ TRANSLOG_PAGE_SIZE, 0, 0) == 0)
{
fprintf(stderr, "pass2: Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_multithread-t.c b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
index 18fbaeace5a..535f363048b 100644
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
@@ -261,7 +261,6 @@ int main(int argc __attribute__((unused)),
char **argv __attribute__ ((unused)))
{
uint32 i;
- uint pagen;
PAGECACHE pagecache;
LSN first_lsn;
TRANSLOG_HEADER_BUFFER rec;
@@ -341,8 +340,8 @@ int main(int argc __attribute__((unused)),
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- TRANSLOG_PAGE_SIZE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ TRANSLOG_PAGE_SIZE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_noflush-t.c b/storage/maria/unittest/ma_test_loghandler_noflush-t.c
index c8c0f7d1873..8d0af947574 100644
--- a/storage/maria/unittest/ma_test_loghandler_noflush-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_noflush-t.c
@@ -34,7 +34,6 @@ static const char *default_dbug_option;
int main(int argc __attribute__((unused)), char *argv[])
{
- uint pagen;
int rc= 1;
uchar long_tr_id[6];
PAGECACHE pagecache;
@@ -71,8 +70,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ PCACHE_PAGE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_nologs-t.c b/storage/maria/unittest/ma_test_loghandler_nologs-t.c
index 24c93e428e1..5d6db7355c2 100644
--- a/storage/maria/unittest/ma_test_loghandler_nologs-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_nologs-t.c
@@ -36,7 +36,6 @@ static const char *default_dbug_option;
int main(int argc __attribute__((unused)), char *argv[])
{
ulong i;
- uint pagen;
uchar long_tr_id[6];
PAGECACHE pagecache;
LSN lsn;
@@ -72,8 +71,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ PCACHE_PAGE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
@@ -145,8 +144,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ PCACHE_PAGE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
index a939cef71a7..e634506628a 100644
--- a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
@@ -64,7 +64,6 @@ dummy_fail_callback(uchar* data_ptr __attribute__((unused)))
int main(int argc __attribute__((unused)), char *argv[])
{
- uint pagen;
uchar long_tr_id[6];
PAGECACHE pagecache;
LSN lsn;
@@ -99,8 +98,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Can't init control file (%d)\n", errno);
exit(1);
}
- if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ if (init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
+ PCACHE_PAGE, 0, 0) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);
diff --git a/storage/maria/unittest/ma_test_loghandler_purge-t.c b/storage/maria/unittest/ma_test_loghandler_purge-t.c
index 6ae0e7830ae..a13645f1bb8 100644
--- a/storage/maria/unittest/ma_test_loghandler_purge-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_purge-t.c
@@ -73,7 +73,7 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(1);
}
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
- PCACHE_PAGE, 0)) == 0)
+ PCACHE_PAGE, 0, 0)) == 0)
{
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
exit(1);