karafka 2.2.3 → 2.2.4

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
  SHA256:
3
- metadata.gz: f79fc941154e12d6f13cdcff51d8a7bb89728fac20d363fc8bd4241c72feea32
4
- data.tar.gz: c5c3e9a61c44d7272fa34329c3d299682ae309d3f9765aa85e3d179c23e8329d
3
+ metadata.gz: 7e6cb6a9b75c85409da5835992ea35b8db57e7f38906d31e2dd4e6345027a357
4
+ data.tar.gz: 40ceebe714cf3db25dcc33a8b5ff8ea1426101aaf18862be907298334beddc16
5
5
  SHA512:
6
- metadata.gz: b1c26344d3de73b003f43385f96f919e5e8a5834d62d03c65acbaa711d1528a5bd353059518bdab6f622c93068197376a4ab423140c9a291e54f38f85e4b76a7
7
- data.tar.gz: d72e445c80beba05315605d12b2b9179b1eab8d271d31301afc48d17bd18cae52bd5bc0aff6f53483dae87e7c9853ca18adea72fc0700d7320fce2eb65d064eb
6
+ metadata.gz: 5e0f780dc0d46e5917df86afba04cb9620547abfc188b550b7667035ed624ab5a36a2dd35e9437fe43d3be66868f409f9d9c3b71d61825b6830261de2a973e27
7
+ data.tar.gz: bc2182903ab8bc48ed431054f2bf23226277608b017b070d8a7cf697b700dc612bea38de3ff1659b481a788e507e1dba0a3972f15e9434bbba8ad0cb48ecb5f5
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Karafka framework changelog
2
2
 
3
- ### 2.2.3 (2023-09-12)
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)
4
7
  - [Fix] Karafka admin time based offset lookup can break for one non-default partition.
5
8
 
6
9
  ## 2.2.2 (2023-09-11)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.2.3)
4
+ karafka (2.2.4)
5
5
  karafka-core (>= 2.2.2, < 2.3.0)
6
6
  thor (>= 0.20)
7
7
  waterdrop (>= 2.6.6, < 3.0.0)
data/docker-compose.yml CHANGED
@@ -1,14 +1,14 @@
1
1
  version: '2'
2
2
  services:
3
3
  zookeeper:
4
- container_name: karafka_21_zookeeper
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: karafka_21_kafka
11
+ container_name: karafka_22_kafka
12
12
  image: wurstmeister/kafka
13
13
  ports:
14
14
  - '9092:9092'
@@ -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&.timestamp || nil,
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
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.2.3'
6
+ VERSION = '2.2.4'
7
7
  end
data.tar.gz.sig CHANGED
@@ -1,4 +1,2 @@
1
- ���N��8"zH�͵���%��InB`��,BJ8��x;����߅ϳ��m�<G~�p4��ز
2
- ��J���yr��f�ٳպ<vy. �ŏ�)=� �Hb��ytCe�_�A���3 ���
3
- z��|��c�U7yٕs�*���x�>lA���f�>��Qg+|ܔg���4����N�޺���K�D��m��&��-�����P/�J@�I|$_5;Yj�vH��Jh��"�v��jTƗ����(҃�\P�;��$\AU@E�mI�h�DzoQD�Q��
4
- 
1
+ �K|%��ϸ{��s\T��"ɪ}�UC����r�s�+7�{�� 3B��%w�av��U�j�� u����֠����<}!6j~�Ki�V�0i�����tS�x<������V݁���Y�v���m���W��Eϸ^n��v�;-�Z9���_�U�E��bT�������ċM�B�M�C>Q"��>������̨wS±}�����7�+��'WJUG��+=�-Lv��ɻ=��?w���(Me ���W�M�AN�j�Yl�M{��Eo�=����pp�k�z!�k�<$��6Ϡ��e�y�5<��;&�y;� Q ��=�Y��}
2
+ ���D���}�YŻ
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.3
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-12 00:00:00.000000000 Z
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