karafka 2.2.2 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/docker-compose.yml +2 -2
- data/lib/karafka/admin.rb +4 -1
- data/lib/karafka/messages/builders/batch_metadata.rb +21 -1
- data/lib/karafka/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e6cb6a9b75c85409da5835992ea35b8db57e7f38906d31e2dd4e6345027a357
|
4
|
+
data.tar.gz: 40ceebe714cf3db25dcc33a8b5ff8ea1426101aaf18862be907298334beddc16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e0f780dc0d46e5917df86afba04cb9620547abfc188b550b7667035ed624ab5a36a2dd35e9437fe43d3be66868f409f9d9c3b71d61825b6830261de2a973e27
|
7
|
+
data.tar.gz: bc2182903ab8bc48ed431054f2bf23226277608b017b070d8a7cf697b700dc612bea38de3ff1659b481a788e507e1dba0a3972f15e9434bbba8ad0cb48ecb5f5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Karafka framework changelog
|
2
2
|
|
3
|
+
## 2.2.4 (2023-09-13)
|
4
|
+
- [Enhancement] Compensate for potential Kafka cluster drifts vs consumer drift in batch metadata (#1611).
|
5
|
+
|
6
|
+
## 2.2.3 (2023-09-12)
|
7
|
+
- [Fix] Karafka admin time based offset lookup can break for one non-default partition.
|
8
|
+
|
3
9
|
## 2.2.2 (2023-09-11)
|
4
10
|
- [Feature] Provide ability to define routing defaults.
|
5
11
|
- [Maintenance] Require `karafka-core` `>=` `2.2.2`
|
data/Gemfile.lock
CHANGED
data/docker-compose.yml
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
version: '2'
|
2
2
|
services:
|
3
3
|
zookeeper:
|
4
|
-
container_name:
|
4
|
+
container_name: karafka_22_zookeeper
|
5
5
|
image: wurstmeister/zookeeper
|
6
6
|
restart: on-failure
|
7
7
|
ports:
|
8
8
|
- '2181:2181'
|
9
9
|
|
10
10
|
kafka:
|
11
|
-
container_name:
|
11
|
+
container_name: karafka_22_kafka
|
12
12
|
image: wurstmeister/kafka
|
13
13
|
ports:
|
14
14
|
- '9092:9092'
|
data/lib/karafka/admin.rb
CHANGED
@@ -257,7 +257,10 @@ module Karafka
|
|
257
257
|
)
|
258
258
|
|
259
259
|
real_offsets = consumer.offsets_for_times(tpl)
|
260
|
-
detected_offset = real_offsets
|
260
|
+
detected_offset = real_offsets
|
261
|
+
.to_h
|
262
|
+
.fetch(name)
|
263
|
+
.find { |p_data| p_data.partition == partition }
|
261
264
|
|
262
265
|
detected_offset&.offset || raise(Errors::InvalidTimeBasedOffsetError)
|
263
266
|
else
|
@@ -26,13 +26,33 @@ module Karafka
|
|
26
26
|
topic: topic.name,
|
27
27
|
# We go with the assumption that the creation of the whole batch is the last message
|
28
28
|
# creation time
|
29
|
-
created_at: messages.last
|
29
|
+
created_at: local_created_at(messages.last),
|
30
30
|
# When this batch was built and scheduled for execution
|
31
31
|
scheduled_at: scheduled_at,
|
32
32
|
# This needs to be set to a correct value prior to processing starting
|
33
33
|
processed_at: nil
|
34
34
|
)
|
35
35
|
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
# Code that aligns the batch creation at into our local time. If time of current machine
|
40
|
+
# and the Kafka cluster drift, this helps not to allow this to leak into the framework.
|
41
|
+
#
|
42
|
+
# @param last_message [::Karafka::Messages::Message, nil] last message from the batch or
|
43
|
+
# nil if no message
|
44
|
+
# @return [Time] batch creation time. Now if no messages (workless flow) or the last
|
45
|
+
# message time as long as the message is not from the future
|
46
|
+
# @note Message can be from the future in case consumer machine and Kafka cluster drift
|
47
|
+
# apart and the machine is behind the cluster.
|
48
|
+
def local_created_at(last_message)
|
49
|
+
now = ::Time.now
|
50
|
+
|
51
|
+
return now unless last_message
|
52
|
+
|
53
|
+
timestamp = last_message.timestamp
|
54
|
+
timestamp > now ? now : timestamp
|
55
|
+
end
|
36
56
|
end
|
37
57
|
end
|
38
58
|
end
|
data/lib/karafka/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
|
36
36
|
msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-09-
|
38
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: karafka-core
|
metadata.gz.sig
CHANGED
Binary file
|