promiscuous-poseidon_cluster 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0a3206a576efca5e80710de7873bdf951b4fda0
4
- data.tar.gz: 588e34330624b29fa6a127b67c24eaafb679a60f
3
+ metadata.gz: bf1cd4ee132f920c59ae5c234b0898b9bad8e24f
4
+ data.tar.gz: 2ad72d1618745591bf199208d43d9b985d00377d
5
5
  SHA512:
6
- metadata.gz: cccda6adc5aade31d9c90fbac1c175cd261848e44d15e2658fde60259ba334a67cfe1b60f2a38c00ba89dbe981b6d97b60bae3a3036260949e48f95530d0dbd2
7
- data.tar.gz: 6ba006802533829e84ff1b2a25f175d4803af498e500dd1f0be4d9b0ff905e5b016b11ff09f301afb399af0c39d8a8aaba631e3842a94506b0a2f20f5f217166
6
+ metadata.gz: 2109520672c090b00f82218e9ea28b12aaecdc80763b5d8c2ca058660c58bbef00bd0f82314f9d71f789d7807f97dd89435519bd0486b1f08967faa18e5f78b9
7
+ data.tar.gz: d4522d89f6a13d4066704600101806a23935f436351e50c03c2dc8705398d5b10ec669acfe9c64e372d87f6710ea824d5f479c4982793e120c09fa3648d4ce09
@@ -125,9 +125,10 @@ class Poseidon::ConsumerGroup
125
125
  # @return [Hash<Symbol,String>] registry paths
126
126
  def registries
127
127
  @registries ||= {
128
+ brokers: "/brokers/topics/#{name}",
128
129
  consumer: "/consumers/#{name}/ids",
129
130
  owner: "/consumers/#{name}/owners/#{topic}",
130
- offset: "/consumers/#{name}/offsets/#{topic}",
131
+ offset: "/consumers/#{name}/offsets/#{topic}"
131
132
  }
132
133
  end
133
134
 
@@ -155,6 +156,7 @@ class Poseidon::ConsumerGroup
155
156
  zk.mkdir_p(path)
156
157
  end
157
158
  zk.create(consumer_path, "{}", {:ephemeral => true})
159
+ zk.register(registries[:brokers]) { rebalance! }
158
160
  zk.register(registries[:consumer]) { rebalance! }
159
161
 
160
162
  rebalance!
@@ -387,6 +389,9 @@ class Poseidon::ConsumerGroup
387
389
  release_all!
388
390
  reload_metadata
389
391
 
392
+ # make sure we rebalance when partition ownership changes
393
+ zk.stat(registries[:brokers], {:watch => true})
394
+
390
395
  consumer_ids = zk.children(registries[:consumer], {:watch => true}).sort
391
396
  partition_list = partitions
392
397
  responsible_for = self.class.pick(partition_list.size, consumer_ids, id)
@@ -38,6 +38,7 @@ describe Poseidon::ConsumerGroup do
38
38
  before do
39
39
  allow(ZK).to receive_messages(new: zk_client)
40
40
  allow(zk_client).to receive(:children).and_return(nil, ["my-group-UNIQUEID"])
41
+ allow(zk_client).to receive(:stat)
41
42
  allow(Poseidon::Cluster).to receive_messages(guid: "UNIQUEID")
42
43
  allow_any_instance_of(Poseidon::ConsumerGroup).to receive(:sleep)
43
44
  allow_any_instance_of(Poseidon::PartitionConsumer).to receive_messages(resolve_offset_if_necessary: 0)
@@ -58,6 +59,7 @@ describe Poseidon::ConsumerGroup do
58
59
  its(:metadata) { should be_instance_of(Poseidon::ClusterMetadata) }
59
60
  its(:topic_metadata) { should be_instance_of(Poseidon::TopicMetadata) }
60
61
  its(:registries) { should == {
62
+ brokers: "/brokers/topics/my-group",
61
63
  consumer: "/consumers/my-group/ids",
62
64
  owner: "/consumers/my-group/owners/mytopic",
63
65
  offset: "/consumers/my-group/offsets/mytopic",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promiscuous-poseidon_cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-27 00:00:00.000000000 Z
12
+ date: 2015-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: poseidon