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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 908368a2c5033abda558ba4f74647dd6747b2079
4
- data.tar.gz: ac49c5dc2fbee643650c0a9ceee2d95661a6ef23
3
+ metadata.gz: 25443019cabb513694fcf76763b3b860ccd9d95c
4
+ data.tar.gz: 1992048e1cf07e0d4c99ca470684612268f7a9a0
5
5
  SHA512:
6
- metadata.gz: 910c5d6d5ebd883cc74ff82a3462a0c88845d4c844bd8a833c3374453ed2cc2fcdbbf56c87dbb93dc7c0533f7b9aea6afad337c4fe75f09d6b3a17efe3095275
7
- data.tar.gz: e8cd314855836d1977a76d7a87bfa1458f751b4506bacc6622fb722cdc29805a77b28e9cc65986db5cf92c103129a961542257e765151f071a79b53a0a586608
6
+ metadata.gz: a3d01a02e30700addf8ae75cfaadfa6eb18e4103208cf9035d378a09a28538ec0c5aa72e2cfa3910f92641bfec26ae54d7c72d85240e105f187dbf0b7a3b5e94
7
+ data.tar.gz: a18069ce4652f9402a31b18103b3082932dc4dab8f13080ea350b9e392e42c2f7d3c913538f1040d4915046f2e6c037654c6b6571c7e90853df2d004bbb4f8a7
data/README.md CHANGED
@@ -16,9 +16,13 @@ Install this tool executing the following command:
16
16
  $ gem install mysqlknife
17
17
  ```
18
18
 
19
- ## Configurarion
19
+ ## Configuration:
20
20
 
21
+ ```shell
21
22
  vim ~/.db.yml
23
+ ```
24
+
25
+ Configuration file example:
22
26
 
23
27
  ```
24
28
  ssh:
@@ -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 = Mysql::Replica.new
153
- @replica.behind = options[:behind]
141
+ @replica = Mysql::Replica.new
154
142
  @replica.skip
155
143
  end
156
144
  end
@@ -5,7 +5,7 @@ module Mysqlknife
5
5
  include Singleton
6
6
 
7
7
  attr_writer :mysql_host,
8
- :mysql_databases
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
- :mysql_databases
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 check_status_negative(behind)
15
- @behind < 0 && behind < 0 && behind <= @behind && behind != 0
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
- status = slave_status
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)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Mysqlknife
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
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.1
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-29 00:00:00.000000000 Z
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.4.5
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