redis_failover 1.0.1 → 1.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.
data/Changes.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.0.2
2
+ -----------
3
+ - Reopen client if an ZK::Exceptions::InterruptedSession occurs (#50, mauricio)
4
+ - Insert the "root_znode" path before "master_redis_node_manager_lock" and expose via accessor (#52, jzaleski)
5
+
1
6
  1.0.1
2
7
  -----------
3
8
  - Bumped required dependency on ZK gem. ZK 1.7.4 fixes a critical bug with locking (see https://github.com/slyphon/zk/issues/54)
@@ -317,7 +317,7 @@ module RedisFailover
317
317
  logger.debug("Fetched nodes: #{nodes.inspect}")
318
318
 
319
319
  nodes
320
- rescue Zookeeper::Exceptions::InheritedConnectionError => ex
320
+ rescue Zookeeper::Exceptions::InheritedConnectionError, ZK::Exceptions::InterruptedSession => ex
321
321
  logger.debug { "Caught #{ex.class} '#{ex.message}' - reopening ZK client" }
322
322
  @zk.reopen
323
323
  retry
@@ -459,6 +459,11 @@ module RedisFailover
459
459
  "#{@root_znode}/nodes"
460
460
  end
461
461
 
462
+ # @return [String] root path for current node manager lock
463
+ def current_lock_path
464
+ "#{@root_znode}/master_redis_node_manager_lock"
465
+ end
466
+
462
467
  # @return [String] the znode path used for performing manual failovers
463
468
  def manual_failover_path
464
469
  ManualFailover.path(@root_znode)
@@ -631,7 +636,7 @@ module RedisFailover
631
636
 
632
637
  # Executes a block wrapped in a ZK exclusive lock.
633
638
  def with_lock
634
- @zk_lock ||= @zk.locker('master_redis_node_manager_lock')
639
+ @zk_lock ||= @zk.locker(current_lock_path)
635
640
 
636
641
  begin
637
642
  @zk_lock.lock!(true)
@@ -1,3 +1,3 @@
1
1
  module RedisFailover
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_failover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-14 00:00:00.000000000 Z
12
+ date: 2013-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -209,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  segments:
211
211
  - 0
212
- hash: -1642431998489370945
212
+ hash: 991009766227287450
213
213
  required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  none: false
215
215
  requirements:
@@ -218,10 +218,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  segments:
220
220
  - 0
221
- hash: -1642431998489370945
221
+ hash: 991009766227287450
222
222
  requirements: []
223
223
  rubyforge_project:
224
- rubygems_version: 1.8.23
224
+ rubygems_version: 1.8.24
225
225
  signing_key:
226
226
  specification_version: 3
227
227
  summary: redis_failover is a ZooKeeper-based automatic master/slave failover solution