Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3d969969
Commit
3d969969
authored
May 04, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parallel-repair available in mysqld
parent
59d6e489
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
9 deletions
+42
-9
myisam/mi_check.c
myisam/mi_check.c
+11
-1
sql/ha_myisam.cc
sql/ha_myisam.cc
+17
-3
sql/mysqld.cc
sql/mysqld.cc
+7
-2
sql/set_var.cc
sql/set_var.cc
+6
-3
sql/sql_class.h
sql/sql_class.h
+1
-0
No files found.
myisam/mi_check.c
View file @
3d969969
...
...
@@ -2246,7 +2246,17 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
else
rec_length
=
share
->
base
.
pack_reclength
;
sort_info
.
max_records
=
((
param
->
testflag
&
T_CREATE_MISSING_KEYS
)
?
info
->
state
->
records
:
/* +1 below is required hack for parallel repair mode.
The info->state->records value, that is compared later
to sort_info.max_records and cannot exceed it, is
increased in sort_key_write. In mi_repair_by_sort, sort_key_write
is called after sort_key_read, where the comparison is performed,
but in parallel mode master thread can call sort_key_write
before some other repair thread calls sort_key_read.
Furthermore I'm not even sure +1 would be enough.
May be sort_info.max_records shold be always set to max value in
parallel mode. */
((
param
->
testflag
&
T_CREATE_MISSING_KEYS
)
?
info
->
state
->
records
+
1
:
(
ha_rows
)
(
sort_info
.
filelength
/
rec_length
+
1
));
del
=
info
->
state
->
del
;
...
...
sql/ha_myisam.cc
View file @
3d969969
...
...
@@ -579,11 +579,25 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
{
local_testflag
|=
T_STATISTICS
;
param
.
testflag
|=
T_STATISTICS
;
// We get this for free
thd
->
proc_info
=
"Repair by sorting"
;
statistics_done
=
1
;
if
(
current_thd
->
variables
.
myisam_repair_threads
>
1
)
{
char
buf
[
40
];
/* TODO: respect myisam_repair_threads variable */
my_snprintf
(
buf
,
40
,
"Repair with %d threads"
,
my_count_bits
(
key_map
));
thd
->
proc_info
=
buf
;
error
=
mi_repair_parallel
(
&
param
,
file
,
fixed_name
,
param
.
testflag
&
T_QUICK
);
thd
->
proc_info
=
"Repair done"
;
// to reset proc_info, as
// it was pointing to local buffer
}
else
{
thd
->
proc_info
=
"Repair by sorting"
;
error
=
mi_repair_by_sort
(
&
param
,
file
,
fixed_name
,
param
.
testflag
&
T_QUICK
);
}
}
else
{
thd
->
proc_info
=
"Repair with keycache"
;
...
...
sql/mysqld.cc
View file @
3d969969
...
...
@@ -3145,7 +3145,7 @@ enum options {
OPT_SORT_BUFFER
,
OPT_TABLE_CACHE
,
OPT_THREAD_CONCURRENCY
,
OPT_THREAD_CACHE_SIZE
,
OPT_TMP_TABLE_SIZE
,
OPT_THREAD_STACK
,
OPT_WAIT_TIMEOUT
,
OPT_WAIT_TIMEOUT
,
OPT_MYISAM_REPAIR_THREADS
,
OPT_INNODB_MIRRORED_LOG_GROUPS
,
OPT_INNODB_LOG_FILES_IN_GROUP
,
OPT_INNODB_LOG_FILE_SIZE
,
...
...
@@ -3839,6 +3839,11 @@ replicating a LOAD DATA INFILE command",
(
gptr
*
)
&
global_system_variables
.
myisam_max_sort_file_size
,
(
gptr
*
)
&
max_system_variables
.
myisam_max_sort_file_size
,
0
,
GET_ULL
,
REQUIRED_ARG
,
(
longlong
)
LONG_MAX
,
0
,
~
0L
,
0
,
1024
*
1024
,
0
},
{
"myisam_repair_threads"
,
OPT_MYISAM_REPAIR_THREADS
,
"Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair."
,
(
gptr
*
)
&
global_system_variables
.
myisam_repair_threads
,
(
gptr
*
)
&
max_system_variables
.
myisam_repair_threads
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
1
,
1
,
~
0L
,
0
,
1
,
0
},
{
"myisam_sort_buffer_size"
,
OPT_MYISAM_SORT_BUFFER_SIZE
,
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE."
,
(
gptr
*
)
&
global_system_variables
.
myisam_sort_buff_size
,
...
...
sql/set_var.cc
View file @
3d969969
...
...
@@ -167,6 +167,7 @@ sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count",
&
max_write_lock_count
);
sys_var_thd_ulonglong
sys_myisam_max_extra_sort_file_size
(
"myisam_max_extra_sort_file_size"
,
&
SV
::
myisam_max_extra_sort_file_size
);
sys_var_thd_ulonglong
sys_myisam_max_sort_file_size
(
"myisam_max_sort_file_size"
,
&
SV
::
myisam_max_sort_file_size
);
sys_var_thd_ulong
sys_myisam_repair_threads
(
"myisam_repair_threads"
,
&
SV
::
myisam_repair_threads
);
sys_var_thd_ulong
sys_myisam_sort_buffer_size
(
"myisam_sort_buffer_size"
,
&
SV
::
myisam_sort_buff_size
);
sys_var_thd_ulong
sys_net_buffer_length
(
"net_buffer_length"
,
&
SV
::
net_buffer_length
);
...
...
@@ -342,6 +343,7 @@ sys_var *sys_variables[]=
&
sys_max_write_lock_count
,
&
sys_myisam_max_extra_sort_file_size
,
&
sys_myisam_max_sort_file_size
,
&
sys_myisam_repair_threads
,
&
sys_myisam_sort_buffer_size
,
&
sys_net_buffer_length
,
&
sys_net_read_timeout
,
...
...
@@ -480,8 +482,9 @@ struct show_var_st init_vars[]= {
{
sys_myisam_max_extra_sort_file_size
.
name
,
(
char
*
)
&
sys_myisam_max_extra_sort_file_size
,
SHOW_SYS
},
{
sys_myisam_max_sort_file_size
.
name
,
(
char
*
)
&
sys_myisam_max_sort_file_size
,
{
sys_myisam_max_sort_file_size
.
name
,
(
char
*
)
&
sys_myisam_max_sort_file_size
,
SHOW_SYS
},
{
sys_myisam_repair_threads
.
name
,
(
char
*
)
&
sys_myisam_repair_threads
,
SHOW_SYS
},
{
"myisam_recover_options"
,
(
char
*
)
&
myisam_recover_options_str
,
SHOW_CHAR_PTR
},
{
sys_myisam_sort_buffer_size
.
name
,
(
char
*
)
&
sys_myisam_sort_buffer_size
,
SHOW_SYS
},
...
...
sql/sql_class.h
View file @
3d969969
...
...
@@ -294,6 +294,7 @@ struct system_variables
ulong
max_heap_table_size
;
ulong
max_sort_length
;
ulong
max_tmp_tables
;
ulong
myisam_repair_threads
;
ulong
myisam_sort_buff_size
;
ulong
net_buffer_length
;
ulong
net_interactive_timeout
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment