Status

Current state: "Under Discussion"

Discussion thread: here

JIRA: here

PR: here

Motivation

Kafka has a dependency on Zookeeper 3.6.3, which reached its end of life in December 2022. We would like to upgrade Zookeeper to version 3.8.1 which is the latest release of the 3.8.x versions.

Zookeeper 3.8.1 server supports clients no older than 3.5.x (i.e. Apache Kafka version 2.4.0) and Zookeeper 3.8.1. clients support server versions no older than 3.5.x (i.e. Apache Kafka version 2.4.0).

ZooKeeper clients from 3.5.x onwards are fully compatible with 3.8.x servers.
The upgrade from 3.6.x and 3.7.x can be executed as usual, no particular additional upgrade procedure is needed.
ZooKeeper 3.8.x clients are compatible with 3.5.x, 3.6.x and 3.7.x servers as long as you are not using new APIs not present these versions.

In comparison, Zookeeper 3.6.3 server supports clients no older than 3.4.x and Zookeeper 3.6.3 clients support server versions no older than 3.5.x

ZooKeeper clients from 3.4 and 3.5 branch are fully compatible with 3.6 servers.
The upgrade from 3.5.7 to 3.6.0 can be executed as usual, no particular additional upgrade procedure is needed.
ZooKeeper 3.6.0 clients are compatible with 3.5 servers as long as you are not using new APIs not present in 3.5.

Public Interfaces

No public interfaces are being changed.

Proposed Changes

Similarly to https://github.com/apache/kafka/pull/12620/files we would like to upgrade to 3.8.1.

Compatibility, Deprecation, and Migration Plan

Users of Kafka clusters with Zookeeper clients older than 3.5.x won't be able to communicate with a 3.8.1 Zookeeper cluster. As mentioned in the accompanying JIRA ticket Kafka has been using Zookeeper clients 3.5.x since version 2.4 so versions above and including it should be safe for this upgrade. It is acceptable to break compatibility with Kafka versions prior to 2.4 as they are considered beyond their end of life and are not maintained. (source: Time Based Release Plan#WhatIsOurEOLPolicy).

A Zookeeper cluster is separate from a Kafka cluster.

For example, a user wanting to migrate from a Kafka cluster with version 2.3 and a Zookeeper cluster with version 3.4 to a Kafka cluster with version 3.X (where X is the Kafka version containing this KIP) and Zookeeper cluster with version 3.8.1 would first have to upgrade their Kafka cluster to 3.4.0 (latest version of the time of writing), then update their Zookeeper cluster to 3.8.1 and lastly update their Kafka cluster again from 3.4.0 to 3.X.

As another example, a user wanting to migrate from a Kafka cluster with version 2.4 and a Zookeeper cluster with version 3.5 to a Kafka cluster with version 3.X and Zookeeper cluster with version 3.8.1 could upgrade their Kafka cluster to 3.X and then their Zookeeper cluster to 3.8.1 or vice versa.

Below is an analysis of changes introduced in 3.7.0 and 3.8.0 and whether they will introduce breaking changes in Kafka or not.

For reference, these are the configurations that Kafka passes onto Zookeeper clients (https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/server/KafkaConfig.scala#L285):

"zookeeper.connect"
"zookeeper.session.timeout.ms"
"zookeeper.connection.timeout.ms"
"zookeeper.set.acl"
"zookeeper.max.in.flight.requests"
"zookeeper.ssl.client.enable"
"zookeeper.clientCnxnSocket"
"zookeeper.ssl.keystore.location"
"zookeeper.ssl.keystore.password"
"zookeeper.ssl.keystore.type"
"zookeeper.ssl.truststore.location"
"zookeeper.ssl.truststore.password"
"zookeeper.ssl.truststore.type"
"zookeeper.ssl.protocol"
"zookeeper.ssl.enabled.protocols"
"zookeeper.ssl.cipher.suites"
"zookeeper.ssl.endpoint.identification.algorithm"
"zookeeper.ssl.crl.enable"
"zookeeper.ssl.ocsp.enable"

Notable Kafka-related changes in Zookeeper 3.7.0

Notable Kafka-related changes in Zookeeper 3.8.0

No other Zookeeper APIs which Kafka uses appear to have been changed.

Test Plan

We ran the following test on the latest trunk of Kafka with Zookeeper 3.6.3 and Zookeeper 3.8.1:

1) Start 1 Zookeeper node on an m5.4xlarge machine

2) Start 1 Kafka broker on a different m5.4xlarge machine

3) Using 4 admin clients sequentially create up to 2000 topics with 1 partition

4) Using 4 admin clients sequentially change the number of partitions on all 2000 topics to 2

5) Using 4 admin clients sequentially delete all topics


Zookeeper 3.8.1 request latency (PROPOSED)

https://g-576b9cd7b5.grafana-workspace.us-east-1.amazonaws.com/dashboard/snapshot/zmXo3V1hC7MkNsGTfD2lZNe6AREk2DwZ?orgId=1

https://g-576b9cd7b5.grafana-workspace.us-east-1.amazonaws.com/dashboard/snapshot/naH2y9jFJsg9greTv72DUu22Q0WvVE2P?orgId=1

Zookeeper 3.6.3 request latency (CURRENT)

https://g-576b9cd7b5.grafana-workspace.us-east-1.amazonaws.com/dashboard/snapshot/yF2EoSNMeSK7BALUdSmqOPAv6QljK2Yn?orgId=1

https://g-576b9cd7b5.grafana-workspace.us-east-1.amazonaws.com/dashboard/snapshot/Vgqt3I8OuPm9upqNvpvMBTs5TrtFY2k5?orgId=1

Rejected Alternatives

If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way. N/A