mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Only install the first masters db and copy it for the other
Gives slightly faster startup mysql-test/lib/mtr_misc.pl: Add verbose message
This commit is contained in:
@ -139,6 +139,8 @@ sub mtr_copy_dir($$) {
|
|||||||
my $from_dir= shift;
|
my $from_dir= shift;
|
||||||
my $to_dir= shift;
|
my $to_dir= shift;
|
||||||
|
|
||||||
|
# mtr_verbose("Copying from $from_dir to $to_dir");
|
||||||
|
|
||||||
mkpath("$to_dir");
|
mkpath("$to_dir");
|
||||||
opendir(DIR, "$from_dir")
|
opendir(DIR, "$from_dir")
|
||||||
or mtr_error("Can't find $from_dir$!");
|
or mtr_error("Can't find $from_dir$!");
|
||||||
|
@ -357,6 +357,7 @@ sub run_benchmarks ($);
|
|||||||
sub initialize_servers ();
|
sub initialize_servers ();
|
||||||
sub mysql_install_db ();
|
sub mysql_install_db ();
|
||||||
sub install_db ($$);
|
sub install_db ($$);
|
||||||
|
sub copy_install_db ($$);
|
||||||
sub run_testcase ($);
|
sub run_testcase ($);
|
||||||
sub run_testcase_stop_servers ($$$);
|
sub run_testcase_stop_servers ($$$);
|
||||||
sub run_testcase_start_servers ($);
|
sub run_testcase_start_servers ($);
|
||||||
@ -2237,7 +2238,7 @@ sub mysql_install_db () {
|
|||||||
|
|
||||||
# FIXME not exactly true I think, needs improvements
|
# FIXME not exactly true I think, needs improvements
|
||||||
install_db('master', $master->[0]->{'path_myddir'});
|
install_db('master', $master->[0]->{'path_myddir'});
|
||||||
install_db('master', $master->[1]->{'path_myddir'});
|
copy_install_db('master', $master->[1]->{'path_myddir'});
|
||||||
|
|
||||||
if ( $use_slaves )
|
if ( $use_slaves )
|
||||||
{
|
{
|
||||||
@ -2302,6 +2303,18 @@ sub mysql_install_db () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub copy_install_db ($$) {
|
||||||
|
my $type= shift;
|
||||||
|
my $data_dir= shift;
|
||||||
|
|
||||||
|
mtr_report("Installing \u$type Database");
|
||||||
|
|
||||||
|
# Just copy the installed db from first master
|
||||||
|
mtr_copy_dir($master->[0]->{'path_myddir'}, $data_dir);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub install_db ($$) {
|
sub install_db ($$) {
|
||||||
my $type= shift;
|
my $type= shift;
|
||||||
my $data_dir= shift;
|
my $data_dir= shift;
|
||||||
@ -2456,7 +2469,7 @@ sub im_prepare_data_dir($) {
|
|||||||
|
|
||||||
foreach my $instance (@{$instance_manager->{'instances'}})
|
foreach my $instance (@{$instance_manager->{'instances'}})
|
||||||
{
|
{
|
||||||
install_db(
|
copy_install_db(
|
||||||
'im_mysqld_' . $instance->{'server_id'},
|
'im_mysqld_' . $instance->{'server_id'},
|
||||||
$instance->{'path_datadir'});
|
$instance->{'path_datadir'});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user