mysqlknife 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/mysqlknife/cli.rb +1 -13
- data/lib/mysqlknife/configs.rb +2 -2
- data/lib/mysqlknife/mysql/replica.rb +7 -9
- data/lib/mysqlknife/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25443019cabb513694fcf76763b3b860ccd9d95c
|
4
|
+
data.tar.gz: 1992048e1cf07e0d4c99ca470684612268f7a9a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3d01a02e30700addf8ae75cfaadfa6eb18e4103208cf9035d378a09a28538ec0c5aa72e2cfa3910f92641bfec26ae54d7c72d85240e105f187dbf0b7a3b5e94
|
7
|
+
data.tar.gz: a18069ce4652f9402a31b18103b3082932dc4dab8f13080ea350b9e392e42c2f7d3c913538f1040d4915046f2e6c037654c6b6571c7e90853df2d004bbb4f8a7
|
data/README.md
CHANGED
data/lib/mysqlknife/cli.rb
CHANGED
@@ -128,17 +128,6 @@ module Mysqlknife
|
|
128
128
|
end
|
129
129
|
|
130
130
|
desc 'skip [CONFIG] [HOST]', 'Skipping the current replication error in Amazon RDS.'
|
131
|
-
long_desc <<-LONGDESC
|
132
|
-
Syntax:
|
133
|
-
|
134
|
-
mysqlknife skip --behind -120
|
135
|
-
LONGDESC
|
136
|
-
option :behind,
|
137
|
-
default: 120,
|
138
|
-
desc: 'Set Seconds Behind Master',
|
139
|
-
required: true,
|
140
|
-
type: :numeric,
|
141
|
-
aliases: :b
|
142
131
|
def skip(conn = nil, host = nil)
|
143
132
|
@parameters.connection = conn
|
144
133
|
@parameters.host = host
|
@@ -149,8 +138,7 @@ module Mysqlknife
|
|
149
138
|
@config.settings(conn)
|
150
139
|
@config.mysql_host = @parameters.host
|
151
140
|
|
152
|
-
@replica
|
153
|
-
@replica.behind = options[:behind]
|
141
|
+
@replica = Mysql::Replica.new
|
154
142
|
@replica.skip
|
155
143
|
end
|
156
144
|
end
|
data/lib/mysqlknife/configs.rb
CHANGED
@@ -5,7 +5,7 @@ module Mysqlknife
|
|
5
5
|
include Singleton
|
6
6
|
|
7
7
|
attr_writer :mysql_host,
|
8
|
-
:
|
8
|
+
:mysql_database
|
9
9
|
attr_reader :path,
|
10
10
|
:ssh_host,
|
11
11
|
:ssh_port,
|
@@ -21,7 +21,7 @@ module Mysqlknife
|
|
21
21
|
:mysql_username,
|
22
22
|
:mysql_password,
|
23
23
|
:mysql_port,
|
24
|
-
:
|
24
|
+
:mysql_database
|
25
25
|
|
26
26
|
def initialize
|
27
27
|
# Define path for config file:
|
@@ -3,20 +3,20 @@
|
|
3
3
|
module Mysqlknife
|
4
4
|
module Mysql
|
5
5
|
class Replica
|
6
|
-
attr_writer :behind
|
7
|
-
|
8
6
|
def initialize
|
9
7
|
@mysql = MySQL.new
|
10
8
|
@mysql_cmd = Mysql::Command.new
|
11
9
|
@mysql_sql = Mysql::SQL.new
|
10
|
+
|
11
|
+
@status = slave_status
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
@
|
14
|
+
def sql_running?
|
15
|
+
@status['Slave_SQL_Running'] == 'Yes'
|
16
16
|
end
|
17
17
|
|
18
18
|
def rds?
|
19
|
-
! @mysql.execute(@mysql_sql.show_procedure('rds_skip_repl_error')).first
|
19
|
+
! @mysql.execute(@mysql_sql.show_procedure('mysql.rds_skip_repl_error')).first
|
20
20
|
end
|
21
21
|
|
22
22
|
def slave_status
|
@@ -24,10 +24,8 @@ module Mysqlknife
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def skip
|
27
|
-
|
28
|
-
|
29
|
-
if check_status_negative(status['Seconds_Behind_Master'])
|
30
|
-
Mysqlknife::Log.new.skip_repl_error(status)
|
27
|
+
unless sql_running?
|
28
|
+
Mysqlknife::Log.new.skip_repl_error(@status)
|
31
29
|
|
32
30
|
if rds?
|
33
31
|
@mysql.execute(@mysql_sql.rds_skip_repl_error)
|
data/lib/mysqlknife/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysqlknife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicola Strappazzon C.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.2.2
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: MySQL and RDS tools for checksum, kill process, swap and resume replication
|