Skip to content

KIP-74 / KAFKA-2063: max_partition_fetch_bytes should now be a soft limit #1232

Closed
@jeffwidman

Description

@jeffwidman

I noticed that the official Kafka consumer config docs for the max_partition_fetch_bytes param now specify that it's a soft limit so that the consumer can make progress: https://kafka.apache.org/documentation/#newconsumerconfigs

It looks like the change happened as part of KIP-74 / KAFKA-2063 / actual implementation, which happened in Kafka 0.10.1.

Here's some of the relevant code in kafka-python that will need to be updated:

  • This size must be at least as large as the maximum message size
    the server allows or else it is possible for the producer to
    send messages larger than the consumer can fetch. If that
    happens, the consumer can get stuck trying to fetch a large
    message on a certain partition. Default: 1048576.
  • def _raise_if_record_too_large(self):
    """Check FetchResponses for messages larger than the max per partition.
    Raises:
    RecordTooLargeError: if there is a message larger than fetch size
    """
    if not self._record_too_large_partitions:
    return
    copied_record_too_large_partitions = dict(self._record_too_large_partitions)
    self._record_too_large_partitions.clear()
    raise RecordTooLargeError(
    "There are some messages at [Partition=Offset]: %s "
    " whose size is larger than the fetch size %s"
    " and hence cannot be ever returned."
    " Increase the fetch size, or decrease the maximum message"
    " size the broker will allow.",
    copied_record_too_large_partitions,
    self.config['max_partition_fetch_bytes'])

This was further amended in Kafka 0.11 as part of KAFKA-5032 which relates to the new V2 message format which @tvoinarovskyi is working on in #1185.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions