Merge lp:~percona-toolkit-dev/percona-toolkit/fix-844880-variableadvisor-bin_log-checks into lp:percona-toolkit/2.1

Proposed by Brian Fraser
Status: Merged
Approved by: Daniel Nichter
Approved revision: 330
Merged at revision: 338
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-844880-variableadvisor-bin_log-checks
Merge into: lp:percona-toolkit/2.1
Diff against target: 140 lines (+27/-10)
3 files modified
bin/pt-variable-advisor (+4/-4)
lib/VariableAdvisorRules.pm (+4/-4)
t/lib/VariableAdvisorRules.t (+19/-2)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-844880-variableadvisor-bin_log-checks
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+117470@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-variable-advisor'
--- bin/pt-variable-advisor 2012-07-20 20:25:10 +0000
+++ bin/pt-variable-advisor 2012-07-31 16:03:21 +0000
@@ -3202,7 +3202,7 @@
3202 code => sub {3202 code => sub {
3203 my ( %args ) = @_;3203 my ( %args ) = @_;
3204 return _var_eq($args{variables}->{expire_log_days}, 0)3204 return _var_eq($args{variables}->{expire_log_days}, 0)
3205 && $args{variables}->{log_bin} ? 1 : 0;3205 && _var_seq($args{variables}->{log_bin}, "ON");
3206 },3206 },
3207 },3207 },
3208 {3208 {
@@ -3235,7 +3235,7 @@
3235 code => sub {3235 code => sub {
3236 my ( %args ) = @_;3236 my ( %args ) = @_;
3237 return _var_seq($args{variables}->{innodb_locks_unsafe_for_binlog},3237 return _var_seq($args{variables}->{innodb_locks_unsafe_for_binlog},
3238 "ON") && $args{variables}->{log_bin} ? 1 : 0;3238 "ON") && _var_seq($args{variables}->{log_bin}, "ON");
3239 },3239 },
3240 },3240 },
3241 {3241 {
@@ -3243,7 +3243,7 @@
3243 code => sub {3243 code => sub {
3244 my ( %args ) = @_;3244 my ( %args ) = @_;
3245 return _var_sneq($args{variables}->{innodb_support_xa}, "ON")3245 return _var_sneq($args{variables}->{innodb_support_xa}, "ON")
3246 && $args{variables}->{log_bin} ? 1 : 0;3246 && _var_seq($args{variables}->{log_bin}, "ON");
3247 },3247 },
3248 },3248 },
3249 {3249 {
@@ -3291,7 +3291,7 @@
3291 code => sub {3291 code => sub {
3292 my ( %args ) = @_;3292 my ( %args ) = @_;
3293 return3293 return
3294 $args{variables}->{log_bin}3294 _var_seq($args{variables}->{log_bin}, "ON")
3295 && ( _var_eq($args{variables}->{sync_binlog}, 0)3295 && ( _var_eq($args{variables}->{sync_binlog}, 0)
3296 || _var_gt($args{variables}->{sync_binlog}, 1)) ? 1 : 0;3296 || _var_gt($args{variables}->{sync_binlog}, 1)) ? 1 : 0;
3297 },3297 },
32983298
=== modified file 'lib/VariableAdvisorRules.pm'
--- lib/VariableAdvisorRules.pm 2012-07-19 16:20:45 +0000
+++ lib/VariableAdvisorRules.pm 2012-07-31 16:03:21 +0000
@@ -431,7 +431,7 @@
431 code => sub {431 code => sub {
432 my ( %args ) = @_;432 my ( %args ) = @_;
433 return _var_eq($args{variables}->{expire_log_days}, 0)433 return _var_eq($args{variables}->{expire_log_days}, 0)
434 && $args{variables}->{log_bin} ? 1 : 0;434 && _var_seq($args{variables}->{log_bin}, "ON");
435 },435 },
436 },436 },
437 {437 {
@@ -464,7 +464,7 @@
464 code => sub {464 code => sub {
465 my ( %args ) = @_;465 my ( %args ) = @_;
466 return _var_seq($args{variables}->{innodb_locks_unsafe_for_binlog},466 return _var_seq($args{variables}->{innodb_locks_unsafe_for_binlog},
467 "ON") && $args{variables}->{log_bin} ? 1 : 0;467 "ON") && _var_seq($args{variables}->{log_bin}, "ON");
468 },468 },
469 },469 },
470 {470 {
@@ -472,7 +472,7 @@
472 code => sub {472 code => sub {
473 my ( %args ) = @_;473 my ( %args ) = @_;
474 return _var_sneq($args{variables}->{innodb_support_xa}, "ON")474 return _var_sneq($args{variables}->{innodb_support_xa}, "ON")
475 && $args{variables}->{log_bin} ? 1 : 0;475 && _var_seq($args{variables}->{log_bin}, "ON");
476 },476 },
477 },477 },
478 {478 {
@@ -520,7 +520,7 @@
520 code => sub {520 code => sub {
521 my ( %args ) = @_;521 my ( %args ) = @_;
522 return522 return
523 $args{variables}->{log_bin}523 _var_seq($args{variables}->{log_bin}, "ON")
524 && ( _var_eq($args{variables}->{sync_binlog}, 0)524 && ( _var_eq($args{variables}->{sync_binlog}, 0)
525 || _var_gt($args{variables}->{sync_binlog}, 1)) ? 1 : 0;525 || _var_gt($args{variables}->{sync_binlog}, 1)) ? 1 : 0;
526 },526 },
527527
=== modified file 't/lib/VariableAdvisorRules.t'
--- t/lib/VariableAdvisorRules.t 2012-07-11 18:21:47 +0000
+++ t/lib/VariableAdvisorRules.t 2012-07-31 16:03:21 +0000
@@ -9,7 +9,7 @@
9use strict;9use strict;
10use warnings FATAL => 'all';10use warnings FATAL => 'all';
11use English qw(-no_match_vars);11use English qw(-no_match_vars);
12use Test::More tests => 83;12use Test::More;
1313
14use PodParser;14use PodParser;
15use AdvisorRules;15use AdvisorRules;
@@ -279,6 +279,10 @@
279 vars => [qw(expire_log_days 0 log_bin ON)],279 vars => [qw(expire_log_days 0 log_bin ON)],
280 advice => [qw(expire_log_days)],280 advice => [qw(expire_log_days)],
281 },281 },
282 { name => "expire_log_days, log_bin OFF, only warns about log_bin",
283 vars => [qw(expire_log_days 0 log_bin OFF)],
284 advice => [qw(log_bin)],
285 },
282 { name => "innodb_file_io_threads",286 { name => "innodb_file_io_threads",
283 vars => [qw(innodb_file_io_threads 16)],287 vars => [qw(innodb_file_io_threads 16)],
284 advice => [qw(innodb_file_io_threads)],288 advice => [qw(innodb_file_io_threads)],
@@ -295,10 +299,18 @@
295 vars => [qw(innodb_locks_unsafe_for_binlog ON log_bin ON)],299 vars => [qw(innodb_locks_unsafe_for_binlog ON log_bin ON)],
296 advice => [qw(innodb_locks_unsafe_for_binlog)],300 advice => [qw(innodb_locks_unsafe_for_binlog)],
297 },301 },
302 { name => "innodb_locks_unsafe_for_binlog, log_bin off, only warns about log_bin",
303 vars => [qw(innodb_locks_unsafe_for_binlog ON log_bin OFF)],
304 advice => [qw(log_bin)],
305 },
298 { name => "innodb_support_xa",306 { name => "innodb_support_xa",
299 vars => [qw(innodb_support_xa OFF log_bin ON)],307 vars => [qw(innodb_support_xa OFF log_bin ON)],
300 advice => [qw(innodb_support_xa)],308 advice => [qw(innodb_support_xa)],
301 },309 },
310 { name => "innodb_support_xa, log_bin OFF, only warns about log_bin",
311 vars => [qw(innodb_support_xa OFF log_bin OFF)],
312 advice => [qw(log_bin)],
313 },
302 { name => "log_bin ON",314 { name => "log_bin ON",
303 vars => [qw(log_bin ON)],315 vars => [qw(log_bin ON)],
304 advice => [qw()],316 advice => [qw()],
@@ -339,6 +351,10 @@
339 vars => [qw(sync_binlog 2 log_bin ON)],351 vars => [qw(sync_binlog 2 log_bin ON)],
340 advice => [qw(sync_binlog)],352 advice => [qw(sync_binlog)],
341 },353 },
354 { name => "log_bin OFF, sync_binlog 0, doesn't warn about sync_binlog",
355 vars => [qw(sync_binlog 0 log_bin OFF)],
356 advice => [qw(log_bin)],
357 },
342 { name => "tmp_table_size",358 { name => "tmp_table_size",
343 vars => [qw(tmp_table_size 1024 max_heap_table_size 512)],359 vars => [qw(tmp_table_size 1024 max_heap_table_size 512)],
344 advice => [qw(tmp_table_size)],360 advice => [qw(tmp_table_size)],
@@ -404,4 +420,5 @@
404 qr/Complete test coverage/,420 qr/Complete test coverage/,
405 '_d() works'421 '_d() works'
406);422);
407exit;423
424done_testing;

Subscribers

People subscribed via source and target branches