Skip to content

Commit 77360a1

Browse files
committed
Expand consumer.fetcher comment re comparing request / response offsets
1 parent 0bda9a4 commit 77360a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kafka/consumer/fetcher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,9 @@ def _handle_fetch_response(self, request, send_time, response):
683683
self._subscriptions.assignment[tp].highwater = highwater
684684

685685
# we are interested in this fetch only if the beginning
686-
# offset matches the current consumed position
686+
# offset (of the *request*) matches the current consumed position
687+
# Note that the *response* may return a messageset that starts
688+
# earlier (e.g., compressed messages) or later (e.g., compacted topic)
687689
fetch_offset = fetch_offsets[tp]
688690
position = self._subscriptions.assignment[tp].position
689691
if position is None or position != fetch_offset:

0 commit comments

Comments
 (0)