Skip to content

Commit 5a94a40

Browse files
authored
docs(clients): updates the client upgrade strategies (#8216)
Signed-off-by: prmellor <pmellor@redhat.com>
1 parent e891a57 commit 5a94a40

File tree

1 file changed

+27
-52
lines changed

1 file changed

+27
-52
lines changed

documentation/modules/upgrading/con-upgrade-strategies-for-upgrading-clients.adoc

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,40 @@
66

77
= Strategies for upgrading clients
88

9-
The right approach to upgrading your client applications (including Kafka Connect connectors) depends on your particular circumstances.
9+
[role="_abstract"]
10+
Upgrading Kafka clients ensures that they benefit from the features, fixes, and improvements that are introduced in new versions of Kafka.
11+
Upgraded clients maintain compatibility with other upgraded Kafka components.
12+
The performance and stability of the clients might also be improved.
1013

11-
Consuming applications need to receive messages in a message format that they understand. You can ensure that this is the case in one of two ways:
14+
Consider the best approach for upgrading Kafka clients and brokers to ensure a smooth transition.
15+
The chosen upgrade strategy depends on whether you are upgrading brokers or clients first.
16+
Since Kafka 3.0, you can upgrade brokers and client independently and in any order.
17+
The decision to upgrade clients or brokers first depends on several factors, such as the number of applications that need to be upgraded and how much downtime is tolerable.
1218

13-
* By upgrading all the consumers for a topic _before_ upgrading any of the producers.
14-
* By having the brokers down-convert messages to an older format.
19+
If you upgrade clients before brokers, some new features may not work as they are not yet supported by brokers.
20+
However, brokers can handle producers and consumers running with different versions and supporting different log message versions.
1521

16-
Using broker down-conversion puts extra load on the brokers, so it is not ideal to rely on down-conversion for all topics for a prolonged period of time.
17-
For brokers to perform optimally they should not be down converting messages at all.
22+
.Upgrading clients when using Kafka versions older than Kafka 3.0
1823

19-
Broker down-conversion is configured in two ways:
24+
Before Kafka 3.0, you would configure a specific message format for brokers using the `log.message.format.version` property (or the `message.format.version` property at the topic level).
25+
This allowed brokers to support older Kafka clients that were using an outdated message format.
26+
Otherwise, the brokers would need to convert the messages from the older clients, which came with a significant performance cost.
2027

21-
* The topic-level `message.format.version` configures it for a single topic.
28+
Apache Kafka Java clients have supported the latest message format version since version 0.11.
29+
If all of your clients are using the latest message version, you can remove the `log.message.format.version` or `message.format.version` overrides when upgrading your brokers.
2230

23-
* The broker-level `log.message.format.version` is the default for topics that do not have the topic-level `message.format.version` configured.
31+
However, if you still have clients that are using an older message format version, we recommend upgrading your clients first.
32+
Start with the consumers, then upgrade the producers before removing the `log.message.format.version` or `message.format.version` overrides when upgrading your brokers.
33+
This will ensure that all of your clients can support the latest message format version and that the upgrade process goes smoothly.
2434

25-
Messages published to a topic in a new-version format will be visible to consumers, because brokers perform down-conversion when they receive messages from producers, not when they are sent to consumers.
35+
You can track Kafka client names and versions using this metric:
2636

27-
Common strategies you can use to upgrade your clients are described as follows.
28-
Other strategies for upgrading client applications are also possible.
37+
* `kafka.server:type=socket-server-metrics,clientSoftwareName=<name>,clientSoftwareVersion=<version>,listener=<listener>,networkProcessor=<processor>`
2938

30-
IMPORTANT: The steps outlined in each strategy change slightly when upgrading to Kafka 3.0.0 or later.
31-
From Kafka 3.0.0, the message format version values are assumed to match the `inter.broker.protocol.version` and don't need to be set.
39+
[TIP]
40+
====
41+
The following Kafka broker metrics help monitor the performance of message down-conversion:
3242
33-
.Broker-level consumers first strategy
34-
35-
. Upgrade all the consuming applications.
36-
. Change the broker-level `log.message.format.version` to the new version.
37-
. Upgrade all the producing applications.
38-
39-
This strategy is straightforward, and avoids any broker down-conversion.
40-
However, it assumes that all consumers in your organization can be upgraded in a coordinated way, and it does not work for applications that are both consumers and producers.
41-
There is also a risk that, if there is a problem with the upgraded clients, new-format messages might get added to the message log so that you cannot revert to the previous consumer version.
42-
43-
.Topic-level consumers first strategy
44-
45-
For each topic:
46-
47-
. Upgrade all the consuming applications.
48-
. Change the topic-level `message.format.version` to the new version.
49-
. Upgrade all the producing applications.
50-
51-
This strategy avoids any broker down-conversion, and means you can proceed on a topic-by-topic basis. It does not work for applications that are both consumers and producers of the same topic. Again, it has the risk that, if there is a problem with the upgraded clients, new-format messages might get added to the message log.
52-
53-
.Topic-level consumers first strategy with down conversion
54-
55-
For each topic:
56-
57-
. Change the topic-level `message.format.version` to the old version
58-
(or rely on the topic defaulting to the broker-level `log.message.format.version`).
59-
. Upgrade all the consuming and producing applications.
60-
. Verify that the upgraded applications function correctly.
61-
. Change the topic-level `message.format.version` to the new version.
62-
63-
This strategy requires broker down-conversion, but the load on the brokers is minimized because it is only required for a single topic (or small group of topics) at a time. It also works for applications that are both consumers and producers of the same topic. This approach ensures that the upgraded producers and consumers are working correctly before you commit to using the new message format version.
64-
65-
The main drawback of this approach is that it can be complicated to manage in a cluster with many topics and applications.
66-
67-
NOTE: It is also possible to apply multiple strategies.
68-
For example, for the first few applications and topics the
69-
"per-topic consumers first, with down conversion" strategy can be used.
70-
When this has proved successful another, more efficient strategy can be considered acceptable to use instead.
43+
* `kafka.network:type=RequestMetrics,name=MessageConversionsTimeMs,request={Produce|Fetch}` provides metrics on the time taken to perform message conversion.
44+
* `kafka.server:type=BrokerTopicMetrics,name={Produce|Fetch}MessageConversionsPerSec,topic=([-.\w]+)` provides metrics on the number of messages converted over a period of time.
45+
====

0 commit comments

Comments
 (0)