Kafka2.3.0发布信息可参考https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=112820648
1.发布时间
KIP Freeze时间:2019年5月11日
Feature Freeze时间:2019年5月17日
Code Freeze时间:2019年5月29日
Release时间:2019年6月12日
2.版本需求
Kafka2.3.0版本对以下29个特性进行了开发。
KIP-465: Add Consolidated Connector Endpoint to Connect REST API
KIP-462: Use local thread id for KStreams
KIP-461: Improve Replica Fetcher behavior at handling partition failure
改进 Replica Fetcher 中的故障处理
为了使副本保持最新,每个 broker 都维护一 Redlica Fetcher 线程池。池中的每个线程负责为一些跟随者分区获取副本。以前,如果其中一个分区失败,整个线程将失败,从而导致可能数百个分区的副本不足。使用此KIP,如果给定副本提取程序线程管理的单个分区失败,则该线程将继续处理其余分区
KIP-458: Connector Client Config Override Policy
KIP-454: Expansion of the ConnectClusterState interface
KIP-453: Add close() method to RocksDBConfigSetter
KIP-449: Add connector contexts to log messages in Connect workers
KIP-445: In-memory Session Store
KIP-443: Return to default segment.ms and segment.index.bytes in Streams repartition topics
KIP-442: Return to default max poll interval in Streams
KIP-436: Add a metric indicating start time
KIP-430 - Return Authorized Operations in Describe Responses
KIP-428: Add in-memory window store
KIP-427: Add AtMinIsr topic partition category (new metric & TopicCommand option)
改进了对 lost replicas 的分区监控为了保证 Kafka 的数据安全,Kaka 在不同的 Broker 上创建了几个副本。除非分区具有最小数量的同步副本,否则 Kafka 将不允许继续写入,这被称为“最小ISR”。
KIP-427 添加了其他指标,显示具有最小同步副本数的分区。通过监视这些指标,用户可以看到哪些分区的副本将不足,从而影响写。
KIP-425: Add some Log4J Kafka Appender Properties for Producing to Secured Brokers
KIP-421: Support resolving externalized secrets in AbstractConfig
KIP-417: Allow JmxTool to connect to a secured RMI port
KIP-415: Incremental Cooperative Rebalancing in Kafka Connect
KIP-411: Make default Kafka Connect worker task client IDs distinct
KIP-402: Improve fairness in SocketServer processors
提高 SocketServer 处理器的公平性
以前,Kafka 会优先考虑在处理现有连接时打开新的 TCP 连接。如果客户端尝试在短时间内创建许多新连接,则可能会出现问题。
KIP-402 将现有连接优先用于新连接,从而提高了 broker 对连接风暴的恢复能力。这个KIP 还为每个 broker 添加 max.connections 参数
KIP-361: Add Consumer Configuration to Disable Auto Topic Creation
KIP-351: Add --under-min-isr option to describe topics command
KIP-351将 --under-min-isr 标签添加到kafka-topics 今里面,这使用户可以轻松查看些主题的副木数量少于最小 ISR 量
KIP-345: Introduce static membership protocol to reduce consumer rebalances
为了解决由于短暂故障引发的频繁重新平衡问题,Apache Kafka 2.3引入了KIP-345的静态成员资格概念。
静态成员资格的核心思想是为每个消费者实例分配一个唯一的标识符(通过配置 group.instance.id 来实现)。JoinGroup请求时会将group.instance.id传给协调器。
如果消费者因暂时故障重启或终止,协调器不会通知其他消费者进行重平衡,直到到达session.timeout.ms设置的时间该消费者还没恢复重启才触发重平衡。原因是消费者在停止时不会发送LeaveGroup请求。
当消费者最终重新加入组时,代理协调器会将之前缓存的分区分配直接返回给该消费者,而无需进行重新平衡。这意味着在静态成员资格下,消费者的重新加入过程更加高效,不会导致整个组的停顿。
使用静态成员资格时,建议将消费者的 session.timeout.ms 属性设置得足够大,以避免代理协调器过于频繁地触发重新平衡。这可以有效减少不必要的重新平衡次数。
然而,尽管静态成员资格可以减少重新平衡的频率,它也带来了一些副作用。较长的 session.timeout.ms 设置意味着协调器可能需要更长的时间才能检测到故障消费者,这可能导致分区在此期间不可用。
这种延迟检测的风险是分布式系统中常见的权衡:在提高系统的可用性和减少不必要的重新平衡之间找到平衡点。不幸的是,这种权衡是不可避免的,系统设计者必须在可用性和容错性之间做出适当的选择。
KIP-339: Create a new IncrementalAlterConfigs API
KIP-331 Add default implementation to close() and configure() for Serializer, Deserializer and Serde
KIP-313: Add KStream.flatTransform and KStream.flatTransformValues
KIP-307: Allow to define custom processor names with KStreams DSL
KIP-258: Allow to Store Record Timestamps in RocksDB
KIP-354: Add a Maximum Log Compaction Lag
添加最大日志压缩延迟
对于一阶近似(frst-order approimation) ,乐缩主题中的键的先前值在写入最新密之后的某个时间被乐缩,只有最新值可里,而以前的值不可用。但是,始终可以设置密银在压缩之前保持的最短时间,因此我们不会太快丢失旧值。现在,使用 P-354,可以设置旧值将保持的最大时间量。新参数 max.oc.compation.time.ms 指定旧值可能存在于乐缩题中的时间长度,这可用干遵守GDPR等数据保留规定