Skip to content

Commit 071b76c

Browse files
gwenshapewencp
authored andcommitted
KAFKA-3852: Clarify how to handle message format upgrade without killing performance
…ing performance Author: Gwen Shapira <cshapi@gmail.com> Reviewers: Ismael Juma <ismael@juma.me.uk>, Ewen Cheslack-Postava <ewen@confluent.io> Closes #1678 from gwenshap/kafka-3852
1 parent 131f968 commit 071b76c

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

docs/upgrade.html

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ <h5><a id="upgrade_1010_notable" href="#upgrade_1010_notable">Notable changes in
2424
</ul>
2525

2626
<h4><a id="upgrade_10" href="#upgrade_10">Upgrading from 0.8.x or 0.9.x to 0.10.0.0</a></h4>
27-
0.10.0.0 has <a href="#upgrade_10_breaking">potential breaking changes</a> (please review before upgrading) and
28-
there may be a <a href="#upgrade_10_performance_impact">performance impact during the upgrade</a>. Because new protocols
29-
are introduced, it is important to upgrade your Kafka clusters before upgrading your clients.
27+
0.10.0.0 has <a href="#upgrade_10_breaking">potential breaking changes</a> (please review before upgrading) and possible <a href="#upgrade_10_performance_impact"> performance impact following the upgrade</a>. By following the recommended rolling upgrade plan below, you guarantee no downtime and no performance impact during and following the upgrade.
28+
<br>
29+
Note: Because new protocols are introduced, it is important to upgrade your Kafka clusters before upgrading your clients.
3030
<p/>
3131
<b>Notes to clients with version 0.9.0.0: </b>Due to a bug introduced in 0.9.0.0,
3232
clients that depend on ZooKeeper (old Scala high-level Consumer and MirrorMaker if used with the old consumer) will not
@@ -36,33 +36,36 @@ <h4><a id="upgrade_10" href="#upgrade_10">Upgrading from 0.8.x or 0.9.x to 0.10.
3636
<p><b>For a rolling upgrade:</b></p>
3737

3838
<ol>
39-
<li> Update server.properties file on all brokers and add the following property: inter.broker.protocol.version=CURRENT_KAFKA_VERSION (e.g. 0.8.2 or 0.9.0.0).
40-
We recommend that users set log.message.format.version=CURRENT_KAFKA_VERSION as well to ensure that performance of 0.8 and 0.9 consumers is not affected
41-
during the upgrade. See <a href="#upgrade_10_performance_impact">potential performance impact during upgrade</a> for the details.
39+
<li> Update server.properties file on all brokers and add the following properties:
40+
<ul>
41+
<li>inter.broker.protocol.version=CURRENT_KAFKA_VERSION (e.g. 0.8.2 or 0.9.0.0).</li>
42+
<li>log.message.format.version=CURRENT_KAFKA_VERSION (See <a href="#upgrade_10_performance_impact">potential performance impact following the upgrade</a> for the details on what this configuration does.)
43+
</ul>
4244
</li>
4345
<li> Upgrade the brokers. This can be done a broker at a time by simply bringing it down, updating the code, and restarting it. </li>
44-
<li> Once the entire cluster is upgraded, bump the protocol version by editing inter.broker.protocol.version and setting it to 0.10.0.0. </li>
46+
<li> Once the entire cluster is upgraded, bump the protocol version by editing inter.broker.protocol.version and setting it to 0.10.0.0. NOTE: You shouldn't touch log.message.format.version yet - this parameter should only change once all consumers have been upgraded to 0.10.0.0 </li>
4547
<li> Restart the brokers one by one for the new protocol version to take effect. </li>
46-
<li> Once most consumers have been upgraded to 0.10.0 and if you followed the recommendation to set log.message.format.version=CURRENT_KAFKA_VERSION, change
47-
log.message.format.version to 0.10.0 on each broker and restart them one by one.
48+
<li> Once all consumers have been upgraded to 0.10.0, change log.message.format.version to 0.10.0 on each broker and restart them one by one.
4849
</li>
4950
</ol>
5051

5152
<p><b>Note:</b> If you are willing to accept downtime, you can simply take all the brokers down, update the code and start all of them. They will start with the new protocol by default.
5253

5354
<p><b>Note:</b> Bumping the protocol version and restarting can be done any time after the brokers were upgraded. It does not have to be immediately after.
5455

55-
<h5><a id="upgrade_10_performance_impact" href="#upgrade_10_performance_impact">Potential performance impact during upgrade to 0.10.0.0</a></h5>
56+
<h5><a id="upgrade_10_performance_impact" href="#upgrade_10_performance_impact">Potential performance impact following upgrade to 0.10.0.0</a></h5>
5657
<p>
5758
The message format in 0.10.0 includes a new timestamp field and uses relative offsets for compressed messages.
5859
The on disk message format can be configured through log.message.format.version in the server.properties file.
5960
The default on-disk message format is 0.10.0. If a consumer client is on a version before 0.10.0.0, it only understands
6061
message formats before 0.10.0. In this case, the broker is able to convert messages from the 0.10.0 format to an earlier format
6162
before sending the response to the consumer on an older version. However, the broker can't use zero-copy transfer in this case.
6263

63-
To avoid such message conversion before consumers are upgraded to 0.10.0.0, one can set the message format to
64-
e.g. 0.9.0 when upgrading the broker to 0.10.0.0. This way, the broker can still use zero-copy transfer to send the
65-
data to the old consumers. Once most consumers are upgraded, one can change the message format to 0.10.0 on the broker.
64+
Reports from the Kafka community on the performance impact have shown CPU utilization going from 20% before to 100% after an upgrade, which forced an immediate upgrade of all clients to bring performance back to normal.
65+
66+
To avoid such message conversion before consumers are upgraded to 0.10.0.0, one can set log.message.format.version to 0.8.2 or 0.9.0 when upgrading the broker to 0.10.0.0. This way, the broker can still use zero-copy transfer to send the data to the old consumers. Once consumers are upgraded, one can change the message format to 0.10.0 on the broker and enjoy the new message format that includes new timestamp and improved compression.
67+
68+
The conversion is supported to ensure compatibility and can be useful to support a few apps that have not updated to newer clients yet, but is impractical to support all consumer traffic on even an overprovisioned cluster. Therefore it is critical to avoid the message conversion as much as possible when brokers have been upgraded but the majority of clients have not.
6669
</p>
6770
<p>
6871
For clients that are upgraded to 0.10.0.0, there is no performance impact.

0 commit comments

Comments
 (0)