List:Maria Storage Engine« Previous MessageNext Message »
From:Guilhem Bichot Date:June 11 2008 3:59pm
Subject:commit into MySQL/Maria:mysql-maria branch (guilhem:2650) Bug#35107, WL#3138
View as plain text  
#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/

 2650 Guilhem Bichot	2008-06-11
      Fix for BUG#35107 "maria-preload.test is disabled because causes assertion"
modified:
  mysql-test/r/maria-preload.result
  mysql-test/t/disabled.def
  storage/maria/ma_check.c

per-file comments:
  mysql-test/r/maria-preload.result
    updating test result. Time will tell if they are reproducible from machine to machine.
  mysql-test/t/disabled.def
    crash is fixed in this revision
  storage/maria/ma_check.c
    Repair code (maria_repair() etc) relies on share->state.state.state (after
    recent changes for WL#3138 "Maria - fast "SELECT COUNT(*) FROM t;" and "CHECKSUM TABLE
t"")
    so this state needs to be correct. When doing bulk insert (like in INSERT SELECT),
maria_write()
    updates info->state.records, which is different from share->state.state if table
has DYNAMIC
    row format; then we go into maria_repair*(), so need to copy info->state into
share->state.state
    which is what update_status does. We were not doing this, so in sort_key_read(),
sort_info->max_records
    was 0 (because info->state.records was 0) so function complained about finding
records
    where it expected 0.
=== modified file 'mysql-test/r/maria-preload.result'
--- a/mysql-test/r/maria-preload.result	2008-06-02 20:53:25 +0000
+++ b/mysql-test/r/maria-preload.result	2008-06-11 15:59:16 +0000
@@ -51,21 +51,21 @@ flush tables;
 flush status;
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	211644
+MARIA_PAGECACHE_READ_REQUESTS	211645
 MARIA_PAGECACHE_READS	3
 select count(*) from t1 where b = 'test1';
 count(*)
 4181
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	211926
+MARIA_PAGECACHE_READ_REQUESTS	211928
 MARIA_PAGECACHE_READS	11
 select count(*) from t1 where b = 'test1';
 count(*)
 4181
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	212208
+MARIA_PAGECACHE_READ_REQUESTS	212211
 MARIA_PAGECACHE_READS	12
 flush tables;
 flush status;
@@ -77,20 +77,20 @@ Table	Op	Msg_type	Msg_text
 test.t1	preload_keys	status	OK
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	212535
+MARIA_PAGECACHE_READ_REQUESTS	212539
 MARIA_PAGECACHE_READS	84
 select count(*) from t1 where b = 'test1';
 count(*)
 4181
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	212817
+MARIA_PAGECACHE_READ_REQUESTS	212822
 MARIA_PAGECACHE_READS	85
 flush tables;
 flush status;
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	213073
+MARIA_PAGECACHE_READ_REQUESTS	213079
 MARIA_PAGECACHE_READS	86
 set session preload_buffer_size=256*1024;
 select @@preload_buffer_size;
@@ -101,20 +101,20 @@ Table	Op	Msg_type	Msg_text
 test.t1	preload_keys	status	OK
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	213400
+MARIA_PAGECACHE_READ_REQUESTS	213407
 MARIA_PAGECACHE_READS	158
 select count(*) from t1 where b = 'test1';
 count(*)
 4181
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	213682
+MARIA_PAGECACHE_READ_REQUESTS	213690
 MARIA_PAGECACHE_READS	165
 flush tables;
 flush status;
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	213938
+MARIA_PAGECACHE_READ_REQUESTS	213947
 MARIA_PAGECACHE_READS	166
 set session preload_buffer_size=1*1024;
 select @@preload_buffer_size;
@@ -126,7 +126,7 @@ test.t1	preload_keys	status	OK
 test.t2	preload_keys	status	OK
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	214308
+MARIA_PAGECACHE_READ_REQUESTS	214318
 MARIA_PAGECACHE_READS	281
 select count(*) from t1 where b = 'test1';
 count(*)
@@ -136,13 +136,13 @@ count(*)
 2584
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	214604
+MARIA_PAGECACHE_READ_REQUESTS	214615
 MARIA_PAGECACHE_READS	285
 flush tables;
 flush status;
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	214860
+MARIA_PAGECACHE_READ_REQUESTS	214872
 MARIA_PAGECACHE_READS	286
 load index into cache t3, t2 key (primary,b) ;
 Table	Op	Msg_type	Msg_text
@@ -151,13 +151,13 @@ test.t3	preload_keys	error	Corrupt
 test.t2	preload_keys	status	OK
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	215159
+MARIA_PAGECACHE_READ_REQUESTS	215172
 MARIA_PAGECACHE_READS	330
 flush tables;
 flush status;
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	215415
+MARIA_PAGECACHE_READ_REQUESTS	215429
 MARIA_PAGECACHE_READS	331
 load index into cache t3 key (b), t2 key (c) ;
 Table	Op	Msg_type	Msg_text
@@ -167,7 +167,7 @@ test.t2	preload_keys	Error	Key 'c' doesn
 test.t2	preload_keys	status	Operation failed
 select g.variable_name,g.variable_value-i.variable_value from
information_schema.global_status as g,initial as i where g.variable_name like
"Maria_pagecache_read%" and g.variable_name=i.variable_name order by g.variable_name
desc;
 variable_name	g.variable_value-i.variable_value
-MARIA_PAGECACHE_READ_REQUESTS	215671
+MARIA_PAGECACHE_READ_REQUESTS	215686
 MARIA_PAGECACHE_READS	332
 drop table t1, t2;
 drop temporary table initial;

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2008-06-02 20:53:25 +0000
+++ b/mysql-test/t/disabled.def	2008-06-11 15:59:16 +0000
@@ -19,4 +19,3 @@ ctype_create         : Bug#32965 main.ct
 status               : Bug#32966 main.status fails
 ps_ddl               : Bug#12093 2007-12-14 pending WL#4165 / WL#4166
 csv_alter_table      : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL
columns in CSV tables
-maria-preload        : Bug#35107 crashes

=== modified file 'storage/maria/ma_check.c'
--- a/storage/maria/ma_check.c	2008-05-29 18:39:25 +0000
+++ b/storage/maria/ma_check.c	2008-06-11 15:59:16 +0000
@@ -2193,6 +2193,15 @@ static int initialize_variables_for_repa
 {
   MARIA_SHARE *share= info->s;
 
+  /*
+    QQ: how do we protect against a concurrent SELECT trying to look at our
+    table while we are repairing the index (case of INSERT SELECT doing
+    bulk insert with repair)?
+  */
+  /* Repair code relies on share->state.state so we have to update it here */
+  if (share->lock.update_status)
+    (*share->lock.update_status)(info);
+
   bzero((char*) sort_info,  sizeof(*sort_info));
   bzero((char*) sort_param, sizeof(*sort_param));
 

Thread
commit into MySQL/Maria:mysql-maria branch (guilhem:2650) Bug#35107, WL#3138Guilhem Bichot11 Jun