| Bug #24566 | Incorrect key file for table ( the size of table is more than 2G) | ||
|---|---|---|---|
| Submitted: | 24 Nov 2006 7:45 | Modified: | 5 Apr 2007 19:53 | 
| Reporter: | Techie Ou | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: MyISAM storage engine | Severity: | S1 (Critical) | 
| Version: | 5.1.12, 5.1.16-BK | OS: | Windows (windows xp sp2) | 
| Assigned to: | Sergey Vojtovich | CPU Architecture: | Any | 
| Tags: | corruption, myisam | ||
   [24 Nov 2006 7:45]
   Techie Ou        
  
 
   [24 Nov 2006 11:20]
   Valeriy Kravchuk        
  Thank you for a problem report. Please, take a look at http://bugs.mysql.com/bug.php?id=24022, and run mysql_fix_privilege_tables.sql as suggested there. You have the same (known) bug in your 5.1.12. Check your test again after that, and inform about the results.
   [27 Nov 2006 9:18]
   Techie Ou        
  Valeriy Kravchuk : I according to your method to run mysql mysql_fix_privilege_tables.sql, and i am starting MySQL service to test my project, but the tabe must be crashed when the size of 'traffic_medium_report_172_16_161_1' table is more than 2G. I have tested three times, the problem was happened when the size of table exceed 2G. please quick check this problem, i wish you support me. If you need other infomation,please tell me. I am sure I don't update from 5.0 to 5.1, I download 5.1.12 zip to install my system, i start MySQL service to test my project. but the problem appeared only the size of table exceed 2G. I try to test three times, but i don't solve this problem. mysql return errors log information: 061127 10:55:09 [Note] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: ready for connections. Version: '5.1.12-beta-community-nt' socket: '' port: 13361 MySQL Community Server (GPL) 061127 10:55:09 [Note] SCHEDULER: Loaded 0 events 061127 12:31:50 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Incorrect key file for table '.\syslog_db_2006_11_27\traffic_medium_report_172_16_161_1.MYI'; try to repair it 061127 12:37:17 [Note] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Normal shutdown 061127 12:37:17 [Note] SCHEDULER: Purging queue. 0 events 061127 12:37:19 [Warning] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Forcing close of thread 16743 user: 'root' 061127 12:37:19 [Warning] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Forcing close of thread 5578 user: 'root' 061127 12:37:19 [Note] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Shutdown complete 061127 12:37:52 [Note] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: ready for connections. Version: '5.1.12-beta-community-nt' socket: '' port: 13361 MySQL Community Server (GPL) 061127 12:37:52 [Note] SCHEDULER: Loaded 0 events 061127 12:38:45 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:38:46 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:38:47 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:38:47 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:38:48 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:38:48 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:39:02 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:39:02 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:39:02 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:39:03 [ERROR] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Table './syslog_db_2006_11_27/traffic_medium_report_172_16_161_1' is marked as crashed and should be repaired 061127 12:47:07 [Note] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Normal shutdown 061127 12:47:07 [Note] SCHEDULER: Purging queue. 0 events 061127 12:47:07 [Note] F:\AceNet1\Reporter\mysql\bin\mysqld-nt.exe: Shutdown complete
   [22 Dec 2006 12:16]
   Valeriy Kravchuk        
  Please, try to repeat with a newer version, 5.1.14, and, in case of the same problem, send the results of SHOW TABLE STATUS and SHOW CREATE TABLE for that traffic_medium_report_172_16_161_1 table.
   [23 Jan 2007 0:00]
   Bugs System        
  No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
   [18 Feb 2007 9:23]
   MySQL Verification Team        
  hi techie, please check if you have myisam_use_mmap enabled or disabled. show global variables like '%mmap%'; If it's enabled, try to disable it in my.ini and see if problems go away.
   [18 Feb 2007 11:13]
   MySQL Verification Team        
  verified on 5.1.16BK using this testcase:
-----------------
drop table if exists t1;
create table t1(c1 bigint not null auto_increment primary key,c2 char(255),key(c2))engine=myisam;
insert into t1(c2) values ('a');
insert into t1(c2) select c2 from t1 limit 1000000; #2
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #4
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #8
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #16
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #32
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #64
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #128
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #256
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #512
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #1024
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #2048
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #4096
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #8179
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #16384
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #32k
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #64k
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #128k
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #256k
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #512k
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #1mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #1mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #2mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #3mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #4mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #5mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #6mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #7mil
select * from t1 order by c2 desc limit 10;
insert into t1(c2) select c2 from t1 limit 1000000; #8mil
select * from t1 order by c2 desc limit 10;
check table t1;
insert into t1 values ();
check table t1;
------------------------
my output:
...
mysql> check table t1;
+---------+-------+----------+----------+
| Table   | Op    | Msg_type | Msg_text |
+---------+-------+----------+----------+
| test.t1 | check | status   | OK       |
+---------+-------+----------+----------+
1 row in set (4 min 23.54 sec)
mysql> insert into t1 values();
ERROR 126 (HY000): Incorrect key file for table '.\test\t1.MYI'; try to repair it
mysql> check table t1;
+---------+-------+----------+-------------------------------------------------------------+
| Table   | Op    | Msg_type | Msg_text                                                    |
+---------+-------+----------+-------------------------------------------------------------+
| test.t1 | check | warning  | Table is marked as crashed                                  |
| test.t1 | check | warning  | Size of datafile is: 2388824328       Should be: 2388824064 |
| test.t1 | check | error    | Found 9048577 keys of 9048576                               |
| test.t1 | check | error    | Corrupt                                                     |
+---------+-------+----------+-------------------------------------------------------------+
4 rows in set (1 min 41.27 sec)
 
   [1 Mar 2007 10:04]
   Techie Ou        
  Hi,Shane. I set 'myisam_use_mmap' variable to disable,but the bug appear in the version of mysql 5.1.14, but the bug don't appear in the version of mysql 5.1.11.
   [1 Mar 2007 10:15]
   MySQL Verification Team        
  Techie, it's ok - i had verified the bug using the above testcase anyway. it's not related to mmap setting. thanks for a bug report!
   [24 Mar 2007 16:28]
   Bugs System        
  A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/22876 ChangeSet@1.2500, 2007-03-25 00:24:39+04:00, svoj@mysql.com +1 -0 BUG#24566 - Incorrect key file for table ( the size of table is more than 2G) Accessing a file that is bigger than 2G may report that read/write operation failed. This may affect anything that uses my_pread/my_pwrite functions, e.g. MyISAM, ARCHIVE, binary log. For MyISAM INSERT may report that table is crashed when writing to a table that is bigger than 2G. This is fixed by using proper offset type in my_pread/my_pwrite functions on systems that do not have native pread/pwrite calls. Affects systems that do not have native pread/pwrite calls, e.g. Windows. No test case for this fix, since it requires huge table.
   [26 Mar 2007 13:02]
   Ingo Strüwing        
  Ok to push from me.
   [30 Mar 2007 17:28]
   Bugs System        
  Pushed into 5.1.18-beta
   [5 Apr 2007 19:53]
   Paul DuBois        
  Noted in 5.1.18 changelog. Access via my_pread() or my_pwrite() to table files larger than 2GB could fail on some systems.
   [22 May 2007 11:14]
   Valeriy Kravchuk        
  Bug #28559 is likely a duplicate of this one.

