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
1=== modified file 'bin/pt-variable-advisor'
2--- bin/pt-variable-advisor 2012-07-20 20:25:10 +0000
3+++ bin/pt-variable-advisor 2012-07-31 16:03:21 +0000
4@@ -3202,7 +3202,7 @@
5 code => sub {
6 my ( %args ) = @_;
7 return _var_eq($args{variables}->{expire_log_days}, 0)
8- && $args{variables}->{log_bin} ? 1 : 0;
9+ && _var_seq($args{variables}->{log_bin}, "ON");
10 },
11 },
12 {
13@@ -3235,7 +3235,7 @@
14 code => sub {
15 my ( %args ) = @_;
16 return _var_seq($args{variables}->{innodb_locks_unsafe_for_binlog},
17- "ON") && $args{variables}->{log_bin} ? 1 : 0;
18+ "ON") && _var_seq($args{variables}->{log_bin}, "ON");
19 },
20 },
21 {
22@@ -3243,7 +3243,7 @@
23 code => sub {
24 my ( %args ) = @_;
25 return _var_sneq($args{variables}->{innodb_support_xa}, "ON")
26- && $args{variables}->{log_bin} ? 1 : 0;
27+ && _var_seq($args{variables}->{log_bin}, "ON");
28 },
29 },
30 {
31@@ -3291,7 +3291,7 @@
32 code => sub {
33 my ( %args ) = @_;
34 return
35- $args{variables}->{log_bin}
36+ _var_seq($args{variables}->{log_bin}, "ON")
37 && ( _var_eq($args{variables}->{sync_binlog}, 0)
38 || _var_gt($args{variables}->{sync_binlog}, 1)) ? 1 : 0;
39 },
40
41=== modified file 'lib/VariableAdvisorRules.pm'
42--- lib/VariableAdvisorRules.pm 2012-07-19 16:20:45 +0000
43+++ lib/VariableAdvisorRules.pm 2012-07-31 16:03:21 +0000
44@@ -431,7 +431,7 @@
45 code => sub {
46 my ( %args ) = @_;
47 return _var_eq($args{variables}->{expire_log_days}, 0)
48- && $args{variables}->{log_bin} ? 1 : 0;
49+ && _var_seq($args{variables}->{log_bin}, "ON");
50 },
51 },
52 {
53@@ -464,7 +464,7 @@
54 code => sub {
55 my ( %args ) = @_;
56 return _var_seq($args{variables}->{innodb_locks_unsafe_for_binlog},
57- "ON") && $args{variables}->{log_bin} ? 1 : 0;
58+ "ON") && _var_seq($args{variables}->{log_bin}, "ON");
59 },
60 },
61 {
62@@ -472,7 +472,7 @@
63 code => sub {
64 my ( %args ) = @_;
65 return _var_sneq($args{variables}->{innodb_support_xa}, "ON")
66- && $args{variables}->{log_bin} ? 1 : 0;
67+ && _var_seq($args{variables}->{log_bin}, "ON");
68 },
69 },
70 {
71@@ -520,7 +520,7 @@
72 code => sub {
73 my ( %args ) = @_;
74 return
75- $args{variables}->{log_bin}
76+ _var_seq($args{variables}->{log_bin}, "ON")
77 && ( _var_eq($args{variables}->{sync_binlog}, 0)
78 || _var_gt($args{variables}->{sync_binlog}, 1)) ? 1 : 0;
79 },
80
81=== modified file 't/lib/VariableAdvisorRules.t'
82--- t/lib/VariableAdvisorRules.t 2012-07-11 18:21:47 +0000
83+++ t/lib/VariableAdvisorRules.t 2012-07-31 16:03:21 +0000
84@@ -9,7 +9,7 @@
85 use strict;
86 use warnings FATAL => 'all';
87 use English qw(-no_match_vars);
88-use Test::More tests => 83;
89+use Test::More;
90
91 use PodParser;
92 use AdvisorRules;
93@@ -279,6 +279,10 @@
94 vars => [qw(expire_log_days 0 log_bin ON)],
95 advice => [qw(expire_log_days)],
96 },
97+ { name => "expire_log_days, log_bin OFF, only warns about log_bin",
98+ vars => [qw(expire_log_days 0 log_bin OFF)],
99+ advice => [qw(log_bin)],
100+ },
101 { name => "innodb_file_io_threads",
102 vars => [qw(innodb_file_io_threads 16)],
103 advice => [qw(innodb_file_io_threads)],
104@@ -295,10 +299,18 @@
105 vars => [qw(innodb_locks_unsafe_for_binlog ON log_bin ON)],
106 advice => [qw(innodb_locks_unsafe_for_binlog)],
107 },
108+ { name => "innodb_locks_unsafe_for_binlog, log_bin off, only warns about log_bin",
109+ vars => [qw(innodb_locks_unsafe_for_binlog ON log_bin OFF)],
110+ advice => [qw(log_bin)],
111+ },
112 { name => "innodb_support_xa",
113 vars => [qw(innodb_support_xa OFF log_bin ON)],
114 advice => [qw(innodb_support_xa)],
115 },
116+ { name => "innodb_support_xa, log_bin OFF, only warns about log_bin",
117+ vars => [qw(innodb_support_xa OFF log_bin OFF)],
118+ advice => [qw(log_bin)],
119+ },
120 { name => "log_bin ON",
121 vars => [qw(log_bin ON)],
122 advice => [qw()],
123@@ -339,6 +351,10 @@
124 vars => [qw(sync_binlog 2 log_bin ON)],
125 advice => [qw(sync_binlog)],
126 },
127+ { name => "log_bin OFF, sync_binlog 0, doesn't warn about sync_binlog",
128+ vars => [qw(sync_binlog 0 log_bin OFF)],
129+ advice => [qw(log_bin)],
130+ },
131 { name => "tmp_table_size",
132 vars => [qw(tmp_table_size 1024 max_heap_table_size 512)],
133 advice => [qw(tmp_table_size)],
134@@ -404,4 +420,5 @@
135 qr/Complete test coverage/,
136 '_d() works'
137 );
138-exit;
139+
140+done_testing;

Subscribers

People subscribed via source and target branches