Skip to content

Commit 3fdcb16

Browse files
committed
WL#14938: Remove multi-threaded myisam repair
RB#27618 the 5.7 version
1 parent 24fa911 commit 3fdcb16

20 files changed

+24
-1522
lines changed

include/my_check_opt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2021, Oracle and/or its affiliates.
1+
/* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License, version 2.0,
@@ -54,7 +54,7 @@ extern "C" {
5454
#define T_READONLY(1UL << 16)
5555
#define T_REP(1UL << 17)
5656
#define T_REP_BY_SORT(1UL << 18)
57-
#define T_REP_PARALLEL(1UL << 19)
57+
#define T_REP_PARALLEL_OBSOLETE(1UL << 19)
5858
#define T_RETRY_WITHOUT_QUICK(1UL << 20)
5959
#define T_SAFE_REPAIR(1UL << 21)
6060
#define T_SILENT(1UL << 22)
@@ -68,7 +68,7 @@ extern "C" {
6868
#define T_WAIT_FOREVER(1UL << 30)
6969
#define T_WRITE_LOOP(1UL << 31)
7070

71-
#define T_REP_ANY(T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
71+
#define T_REP_ANY(T_REP | T_REP_BY_SORT)
7272

7373
#ifdef__cplusplus
7474
}

include/myisam.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -395,8 +395,6 @@ typedef struct st_mi_check_param
395395
const char *db_name, *table_name;
396396
const char *op_name;
397397
enum_mi_stats_method stats_method;
398-
mysql_mutex_t print_msg_mutex;
399-
my_bool need_print_msg_lock;
400398
} MI_CHECK;
401399

402400
typedef struct st_sort_ft_buf
@@ -418,10 +416,6 @@ typedef struct st_sort_info
418416
uchar *buff;
419417
SORT_KEY_BLOCKS *key_block,*key_block_end;
420418
SORT_FT_BUF *ft_buf;
421-
/* sync things */
422-
uint got_error, threads_running;
423-
mysql_mutex_t mutex;
424-
mysql_cond_t cond;
425419
} SORT_INFO;
426420

427421
/* functions in mi_check */
@@ -437,8 +431,6 @@ int mi_sort_index(MI_CHECK *param, MI_INFO *info, char * name,
437431
my_bool no_copy_stat);
438432
int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info,
439433
const char * name, int rep_quick, my_bool no_copy_stat);
440-
int mi_repair_parallel(MI_CHECK *param, MI_INFO *info,
441-
const char * name, int rep_quick, my_bool no_copy_stat);
442434
int change_to_newfile(const char * filename, const char * old_ext,
443435
const char * new_ext, myf myflags);
444436
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,

mysql-test/r/fulltext.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,9 @@ COUNT(*)
459459
DROP TABLE t1;
460460
CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a));
461461
INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
462-
SET myisam_repair_threads=2;
463-
Warnings:
464-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
465462
REPAIR TABLE t1;
466463
Table Op Msg_type Msg_text
467464
test.t1 repair status OK
468-
SET myisam_repair_threads=@@global.myisam_repair_threads;
469465
INSERT INTO t1 VALUES('testword\'\'');
470466
SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE);
471467
a

mysql-test/r/myisam.result

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,6 @@ a b
827827
xxxxxxxxx bbbbbb
828828
xxxxxxxxx bbbbbb
829829
DROP TABLE t1;
830-
SET @@myisam_repair_threads=2;
831-
Warnings:
832-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
833-
SHOW VARIABLES LIKE 'myisam_repair%';
834-
Variable_name Value
835-
myisam_repair_threads 2
836830
CREATE TABLE t1 (
837831
`_id` int(11) NOT NULL default '0',
838832
`url` text,
@@ -951,10 +945,6 @@ _id
951945
8
952946
9
953947
DROP TABLE t1;
954-
SET @@myisam_repair_threads=1;
955-
SHOW VARIABLES LIKE 'myisam_repair%';
956-
Variable_name Value
957-
myisam_repair_threads 1
958948
CREATE TABLE t1(a VARCHAR(16));
959949
INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);
960950
UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';
@@ -1890,12 +1880,8 @@ SHOW TABLE STATUS LIKE 't1';
18901880
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
18911881
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
18921882
# Enable keys with parallel repair
1893-
SET @@myisam_repair_threads=2;
1894-
Warnings:
1895-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
18961883
ALTER TABLE t1 DISABLE KEYS;
18971884
ALTER TABLE t1 ENABLE KEYS;
1898-
SET @@myisam_repair_threads=1;
18991885
CHECK TABLE t1 EXTENDED;
19001886
Table Op Msg_type Msg_text
19011887
test.t1 check status OK
@@ -2413,11 +2399,7 @@ Table Op Msg_type Msg_text
24132399
test.t1 repair error myisam_sort_buffer_size is too small
24142400
test.t1 repair warning Number of rows changed from 0 to 7168
24152401
test.t1 repair status OK
2416-
SET myisam_repair_threads=2;
2417-
Warnings:
2418-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
24192402
REPAIR TABLE t1;
2420-
SET myisam_repair_threads=@@global.myisam_repair_threads;
24212403
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
24222404
CHECK TABLE t1;
24232405
Table Op Msg_type Msg_text
@@ -2489,30 +2471,6 @@ a a
24892471
1 1
24902472
DROP TABLE t1;
24912473
#
2492-
# BUG#47444 - --myisam_repair_threads>1can result in all index
2493-
# cardinalities=1
2494-
#
2495-
SET myisam_repair_threads=2;
2496-
Warnings:
2497-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
2498-
SET myisam_sort_buffer_size=4096;
2499-
CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a));
2500-
Warnings:
2501-
Warning 1831 Duplicate index 'a_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
2502-
Warning 1831 Duplicate index 'a_3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
2503-
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3);
2504-
REPAIR TABLE t1;
2505-
Table Op Msg_type Msg_text
2506-
test.t1 repair status OK
2507-
SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
2508-
CARDINALITY
2509-
14
2510-
14
2511-
14
2512-
DROP TABLE t1;
2513-
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
2514-
SET myisam_repair_threads=@@global.myisam_repair_threads;
2515-
#
25162474
# BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
25172475
# USING MYISAM_USE_MMAP ON WINDOWS
25182476
#

mysql-test/r/mysqld--help-notwin.result

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,6 @@ The following options may be given as the first argument:
601601
--myisam-recover-options[=name]
602602
Syntax: myisam-recover-options[=option[,option...]],
603603
where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF
604-
--myisam-repair-threads=#
605-
DEPRECATED. If larger than 1, when repairing a MyISAM
606-
table all indexes will be created in parallel, with one
607-
thread per index. The value of 1 disables parallel repair
608604
--myisam-sort-buffer-size=#
609605
The buffer that is allocated when sorting the index when
610606
doing a REPAIR or when creating indexes with CREATE INDEX
@@ -1455,7 +1451,6 @@ myisam-data-pointer-size 6
14551451
myisam-max-sort-file-size 9223372036853727232
14561452
myisam-mmap-size 18446744073709551615
14571453
myisam-recover-options OFF
1458-
myisam-repair-threads 1
14591454
myisam-sort-buffer-size 8388608
14601455
myisam-stats-method nulls_unequal
14611456
myisam-use-mmap FALSE

mysql-test/r/mysqld--help-win.result

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,6 @@ The following options may be given as the first argument:
591591
--myisam-recover-options[=name]
592592
Syntax: myisam-recover-options[=option[,option...]],
593593
where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF
594-
--myisam-repair-threads=#
595-
DEPRECATED. If larger than 1, when repairing a MyISAM
596-
table all indexes will be created in parallel, with one
597-
thread per index. The value of 1 disables parallel repair
598594
--myisam-sort-buffer-size=#
599595
The buffer that is allocated when sorting the index when
600596
doing a REPAIR or when creating indexes with CREATE INDEX
@@ -1453,7 +1449,6 @@ myisam-data-pointer-size 6
14531449
myisam-max-sort-file-size 9223372036853727232
14541450
myisam-mmap-size 18446744073709551615
14551451
myisam-recover-options OFF
1456-
myisam-repair-threads 1
14571452
myisam-sort-buffer-size 8388608
14581453
myisam-stats-method nulls_unequal
14591454
myisam-use-mmap FALSE

mysql-test/r/repair.result

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ Table Op Msg_type Msg_text
3939
test.t1 repair warning Number of rows changed from 0 to 1
4040
test.t1 repair status OK
4141
drop table t1;
42-
CREATE TABLE t1(a INT, KEY(a));
43-
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
44-
SET myisam_repair_threads=2;
45-
Warnings:
46-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
47-
REPAIR TABLE t1;
48-
Table Op Msg_type Msg_text
49-
test.t1 repair status OK
50-
SHOW INDEX FROM t1;
51-
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
52-
t1 1 a 1 a A 5 NULL NULL YES BTREE
53-
SET myisam_repair_threads=@@global.myisam_repair_threads;
54-
DROP TABLE t1;
5542
CREATE TABLE t1(a INT);
5643
USE mysql;
5744
REPAIR TABLE test.t1 USE_FRM;
@@ -81,15 +68,11 @@ INSERT INTO t1 VALUES
8168
Warnings:
8269
Error 1034 myisam_sort_buffer_size is too small
8370
Error 1034 Number of rows changed from 0 to 157
84-
SET myisam_repair_threads=2;
85-
Warnings:
86-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
8771
REPAIR TABLE t1;
8872
Table Op Msg_type Msg_text
8973
test.t1 repair error myisam_sort_buffer_size is too small
9074
test.t1 repair warning Number of rows changed from 0 to 157
9175
test.t1 repair status OK
92-
SET myisam_repair_threads=@@global.myisam_repair_threads;
9376
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
9477
DROP TABLE t1;
9578
CREATE TABLE t1(a CHAR(255), KEY(a));
@@ -111,13 +94,9 @@ INSERT INTO t1 VALUES
11194
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
11295
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
11396
('0'),('0'),('0'),('0'),('0'),('0'),('0');
114-
SET myisam_repair_threads=2;
115-
Warnings:
116-
Warning 1681 '@@myisam_repair_threads' is deprecated and will be removed in a future release.
11797
REPAIR TABLE t1;
11898
Table Op Msg_type Msg_text
11999
test.t1 repair status OK
120-
SET myisam_repair_threads=@@global.myisam_repair_threads;
121100
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
122101
DROP TABLE t1;
123102
End of 4.1 tests

0 commit comments

Comments
 (0)