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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ec886a34
Commit
ec886a34
authored
Dec 19, 2007
by
msvensson@pilot.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use dynamic switch directly from "server_need_restart" for better control of when to do it.
Remove #!force-restart and #!fresh-datadir
parent
87283f40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
69 deletions
+47
-69
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+47
-63
mysql-test/suite/rpl/rpl_1slave_base.cnf
mysql-test/suite/rpl/rpl_1slave_base.cnf
+0
-6
No files found.
mysql-test/mysql-test-run.pl
View file @
ec886a34
...
...
@@ -2066,33 +2066,26 @@ sub run_testcase_check_skip_test($)
return
0
;
}
sub
dynamic_binlog_format_switch
{
my
(
$tinfo
)
=
@_
;
# Dynamically switch binlog format started MySQL servers
foreach
my
$mysqld
(
mysqlds
()
)
{
# Skip servers that are restarted between each test
next
if
$mysqld
->
option
('
#!force-restart
');
my
(
$tinfo
,
$mysqld
)
=
@_
;
my
$sql
=
"
include/set_binlog_format_
"
.
$tinfo
->
{
binlog_format_switch
}
.
"
.sql
";
my
$args
;
mtr_init_args
(
\
$args
);
mtr_add_arg
(
$args
,
"
--defaults-file=%s
",
$path_config_file
);
mtr_add_arg
(
$args
,
"
--defaults-group-suffix=%s
",
$mysqld
->
after
('
mysqld
'));
mtr_verbose
("
Dynamically switching binlog format to:
",
$tinfo
->
{
binlog_format_switch
});
my
$res
=
My::
SafeProcess
->
run
(
name
=>
"
switch binlog format
"
.
$mysqld
->
name
(),
path
=>
$exe_mysql
,
args
=>
\
$args
,
input
=>
$sql
,
my
$sql
=
"
include/set_binlog_format_
"
.
$tinfo
->
{
binlog_format_switch
}
.
"
.sql
";
my
$args
;
mtr_init_args
(
\
$args
);
mtr_add_arg
(
$args
,
"
--defaults-file=%s
",
$path_config_file
);
mtr_add_arg
(
$args
,
"
--defaults-group-suffix=%s
",
$mysqld
->
after
('
mysqld
'));
my
$res
=
My::
SafeProcess
->
run
(
name
=>
"
switch binlog format
"
.
$mysqld
->
name
(),
path
=>
$exe_mysql
,
args
=>
\
$args
,
input
=>
$sql
,
);
if
(
$res
!=
0
)
{
mtr_error
("
Failed to switch binlog format
");
}
if
(
$res
!=
0
)
{
mtr_error
("
Failed to switch binlog format
");
}
}
...
...
@@ -2287,11 +2280,6 @@ sub run_testcase ($) {
do_before_run_mysqltest
(
$tinfo
);
if
(
defined
$tinfo
->
{
binlog_format_switch
}
)
{
dynamic_binlog_format_switch
(
$tinfo
)
}
if
(
$opt_check_testcases
)
{
run_check_testcase_all
(
$tinfo
,
"
before
")
...
...
@@ -2779,11 +2767,6 @@ sub server_need_restart {
return
0
;
}
if
(
$server
->
option
('
#!force-restart
')
)
{
mtr_verbose
("
Restart: forced in configuration
");
return
1
;
}
if
(
$tinfo
->
{'
force_restart
'}
)
{
mtr_verbose
("
Restart: forced in .opt file
");
return
1
;
...
...
@@ -2820,31 +2803,38 @@ sub server_need_restart {
}
}
# Check that running process was started with same options
# as the current test requires
my
$extra_opt
=
get_extra_opt
(
$server
,
$tinfo
);
my
$started_opts
=
$server
->
{'
started_opts
'};
if
(
defined
$started_opts
and
$extra_opt
and
!
mtr_same_opts
(
$started_opts
,
$extra_opt
)
)
{
# Check if diff is binlog format only
# and the next test has $binlog_format_switch set
my
@diff_opts
=
mtr_diff_opts
(
$started_opts
,
$extra_opt
);
if
(
@diff_opts
==
2
and
$diff_opts
[
0
]
=~
/^--binlog-format=/
and
$diff_opts
[
1
]
=~
/^--binlog-format=/
and
defined
$tinfo
->
{
binlog_format_switch
})
{
mtr_verbose
("
Using dynamic switch of binlog format from
",
$diff_opts
[
0
],"
to
",
$diff_opts
[
1
]);
}
else
{
my
$is_mysqld
=
grep
(
$server
eq
$_
,
mysqlds
());
if
(
$is_mysqld
)
{
mtr_verbose
("
Restart: running with different options '
"
.
join
("
",
@
{
$extra_opt
})
.
"
' != '
"
.
join
("
",
@
{
$server
->
{'
started_opts
'}})
.
"
'
"
);
return
1
;
# Check that running process was started with same options
# as the current test requires
my
$extra_opt
=
get_extra_opt
(
$server
,
$tinfo
);
my
$started_opts
=
$server
->
{'
started_opts
'};
if
(
defined
$started_opts
and
$extra_opt
and
!
mtr_same_opts
(
$started_opts
,
$extra_opt
)
)
{
# TODO Use a list to find all options that can be set dynamically
# Check if diff is binlog format only
# and the next test has $binlog_format_switch set
my
@diff_opts
=
mtr_diff_opts
(
$started_opts
,
$extra_opt
);
if
(
@diff_opts
==
2
and
$diff_opts
[
0
]
=~
/^--binlog-format=/
and
$diff_opts
[
1
]
=~
/^--binlog-format=/
and
defined
$tinfo
->
{
binlog_format_switch
})
{
mtr_verbose
("
Using dynamic switch of binlog format from
",
$diff_opts
[
0
],"
to
",
$diff_opts
[
1
]);
dynamic_binlog_format_switch
(
$tinfo
,
$server
);
}
else
{
mtr_verbose
("
Restart: running with different options '
"
.
join
("
",
@
{
$extra_opt
})
.
"
' != '
"
.
join
("
",
@
{
$server
->
{'
started_opts
'}})
.
"
'
"
);
return
1
;
}
}
}
...
...
@@ -2985,12 +2975,6 @@ sub start_servers($) {
# Don't delete anything if starting dirty
if
(
!
$opt_start_dirty
)
{
# Remove old datadir before starting process
if
(
$mysqld
->
option
('
#!fresh-datadir
')
and
-
d
$datadir
)
{
mtr_debug
("
Removing old datadir: '
$datadir
'
");
rmdir
(
$datadir
);
}
my
@options
=
('
log-bin
',
'
relay-log
');
foreach
my
$option_name
(
@options
)
{
...
...
mysql-test/suite/rpl/rpl_1slave_base.cnf
View file @
ec886a34
...
...
@@ -16,12 +16,6 @@ log-bin= master-bin
# starting the mysqld
#!use-slave-opt
# Force restart between each test case
#!force-restart
# Always install a fresh datadir before starting process
#!fresh-datadir
log-bin= slave-bin
relay-log= slave-relay-bin
...
...
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