Kafka0.11.0.0版本信息


发布于 2017-06-17 / 62 阅读 / 0 评论 /
Kafka0.11.0.0版本内容和发布时间

Kafka0.11.0.0发布信息可参考https://cwiki.apache.org/confluence/display/KAFKA/Release+Plan+0.11.0.0

1.发布时间

KIP Freeze时间:2017年5月10日

Feature Freeze时间:2017年5月17日

Code Freeze时间:2017年5月31日

Release时间:2017年6月14日

2.核心特性

0.11是一个里程碑式的大版本,特别是Kafka从这个版本开始支持“exactly-once”语义(下称EOS, exactly-once semantics)。

EOS是流式处理实现正确性的基石。主流的流式处理框架基本都支持EOS(如Storm Trident, Spark Streaming, Flink),Kafka streams肯定也要支持的。0.11版本通过3个大的改动支持EOS:

(1)幂等的producer

(2)支持事务

(3)支持EOS的流式处理(保证“读-处理-写”全链路的EOS)

3.版本需求

Kafka0.11.0.0版本对以下32个特性进行了开发。

KIP-54: Sticky Partition Assignment Strategy

新的分配算法:StickyAssignor

比range和round-robin更加平衡的分配算法。指定partition.assignment.strategy = org.apache.kafka.clients.consumer.StickyAssignor可以尝尝鲜。不过根据我的经验,分配不均匀的情况通常发生在每个consumer订阅topic差别很大的时候。比如consumer1订阅topic1, topic2, topic4, consumer2订阅topic3, topic4这种情况

KIP-66: Single Message Transforms for Kafka Connect (items not included in 0.10.2.0)

KIP-82 - Add Record Headers

消息增加头部信息(Header)

Record增加了Header,每个header是一个KV存储。

KIP-98 - Exactly Once Delivery and Transactional Messaging

KIP-101 - Alter Replication Protocol to use Leader Epoch rather than High Watermark for Truncation

KIP-106 - Change Default unclean.leader.election.enabled from True to False

修改unclean.leader.election.enabled默认值

Kafka社区终于下定决心要把这个参数的默认值改成false,即不再允许出现unclean leader选举的情况,在正确性和高可用性之间选择了前者。如果依然要启用它,用户需要显式地设置server.properties=true

KIP-107: Add purgeDataBefore() API in AdminClient

KIP-109: Old Consumer Deprecation

KIP-114: KTable state stores and improved semantics

KIP-115: Enforce offsets.topic.replication.factor upon __consumer_offsets auto topic creation

确保offsets.topic.replication.factor参数被正确应用

__consumer_offsets这个topic是Kafka自动创建的,在创建的时候如果集群broker数 < offsets.topic.replication.factor,原先的版本取其小者,但这会违背用户设置该参数的初衷。因此在0.11版本中这个参数会被强制遵守,如果不满足该参数设定的值,会抛出GROUP_COORDINATOR_NOT_AVAILABLE。

KIP-117: Add a public AdminClient API for Kafka admin operations

KIP-119: Drop Support for Scala 2.10 in Kafka 0.11

KIP-121: Add KStream peek method

KIP-122: Add Reset Consumer Group Offsets tooling

KIP-123: Allow per stream/table timestamp extractor

KIP-124 - Request rate quotas

KIP-126 - Allow KafkaProducer to split and resend oversized batches.

KIP-128: Add ByteArrayConverter for Kafka Connect

KIP-129: Streams Exactly-Once Semantics

支持EOS

0.11最重要的功能,没有之一!EOS是流式处理实现正确性的基石。

KIP-133: Describe and Alter Configs Admin APIs

KIP-134: Delay initial consumer group rebalance

空消费者组延时rebalance

为了缩短多consumer首次rebalance的时间,增加了“group.initial.rebalance.delay.ms”用于设置group开启rebalance的延时时间。这段延时期间允许更多的consumer加入组,避免不必要的JoinGroup与SyncGroup之间的切换。当然凡事都是trade-off,引入这个必然带来消费延时。

KIP-136: Add Listener name to SelectorMetrics tags

KIP-137: Enhance TopicCommand --describe to show topics marked for deletion

KIP-140: Add administrative RPCs for adding, deleting, and listing ACLs

KIP-143: Controller Health Metrics

KIP-144: Exponential backoff for broker reconnect attempts

KIP-146 - Classloading Isolation in Connect

KIP-151 Expose Connector type in REST API

KIP-153: Include only client traffic in BytesOutPerSec metric

KIP-154 Add Kafka Connect configuration properties for creating internal topics

KIP 155 - Add range scan for windowed state stores

KIP 156 Add option "dry run" to Streams application reset tool