Skip to content

KAFKA-15208: Upgrade Jackson dependencies to version 2.16.0#13662

Merged
mimaison merged 11 commits into
apache:trunkfrom
bmscomp:upgrade/jackson_version_to_2.15.0
Dec 19, 2023
Merged

KAFKA-15208: Upgrade Jackson dependencies to version 2.16.0#13662
mimaison merged 11 commits into
apache:trunkfrom
bmscomp:upgrade/jackson_version_to_2.15.0

Conversation

@bmscomp

@bmscomp bmscomp commented May 2, 2023

Copy link
Copy Markdown
Contributor

Upgrade Jackson dependencies to version 2.16.0

  • Unify the Jackson and Jackson Data bind dependencies and upgrade to the latest stable version 2.15.2
  • Remove deprecation call of JsonNodeFactory.withExactBigDecimals
  • Fix some typos in comments and documentation

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@bmscomp bmscomp changed the title MINOR: Upgrade Jackson dependencies to version to 2.15.0 MINOR: Upgrade Jackson dependencies to version 2.15.0 May 2, 2023
@bmscomp

bmscomp commented May 4, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya this pull request targets an update to version 2.15.0, please can you tell me better about updating not only minor versions ?

@divijvaidya

Copy link
Copy Markdown
Member

@bmscomp this is a nice PR and I support it. I opened the other one ( #13673 ) for minor versions upgrades because minor versions have a lower risk and require less detailed review for reviewers. My ideal situation would be if we can merge the minor version updates into the upcoming 3.5 (it's safe because of minor upgrades) and then target key major version upgrades of dependencies such as this PR for 3.6. Nevertheless, let's hear back from what other folks in the community have to say about this.

(If the minor version PR doesn't make it to 3.5, I will remove jackson changes from it so that jackson can be addressed by this PR).

@bmscomp

bmscomp commented May 5, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya I get your point, thanks so much for those explanations

@ijuma

ijuma commented May 12, 2023

Copy link
Copy Markdown
Member

It would be better to have a separate PR for clean-ups unrelated to the Jackson dependency update.

@bmscomp

bmscomp commented May 12, 2023

Copy link
Copy Markdown
Contributor Author

@ijuma thank you for the comment, I'll update this pull PR and make another one for clean-ups

@bmscomp
bmscomp force-pushed the upgrade/jackson_version_to_2.15.0 branch 2 times, most recently from 3838fd2 to 950d2d5 Compare May 13, 2023 20:35
@bmscomp

bmscomp commented May 13, 2023

Copy link
Copy Markdown
Contributor Author

@ijuma the PR is updated , I managed to keep only modifications related to the upgrade of Jackson version to 2.15.0, I'll make another separate PR related to clean-ups

@divijvaidya

Copy link
Copy Markdown
Member

Breaking changes between 2.13.x and 2.15.x:

  1. @JsonIgnore gets more precedence than @JsonProperty in 2.15.x in case both annotations are assigned to a property. Prior to 2.14.x, it was the opposite precedence. See: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.14#observedreported-changes
    This should not impact Kafka since I couldn't find usages of @JsonIgnore in the code base.

  2. ProcessingLimits adds limitation to length of different tokens. Prior to 2.15.x, there was no limits. See: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15#processing-limits
    Verified that FileBasedStateStore is not impacted by the new limits.

  3. Modified handling of datetime with zone information in it. See: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15#changes-behavior-other

@bmscomp could you please go through the usage of Jackson in Kafka code base and add here (similar to above) on why the new processing limits won't impact existing code (or comment if we want to increase the limits from default values). Same for ZoneId handling. Given the number of breaking changes, I think we should also create a JIRA for this (and associate the PR). This is not a minor change!

Thanks!

@divijvaidya

Copy link
Copy Markdown
Member

I found today that there is another change that needs to make it in this PR. We need to update the LICENSE file with the correct version at https://github.com/apache/kafka/blob/trunk/LICENSE-binary#L211

@divijvaidya divijvaidya added the dependencies Pull requests that update a dependency file label May 24, 2023
@showuon

showuon commented Jun 7, 2023

Copy link
Copy Markdown
Member

@bmscomp , could you respond to @divijvaidya 's comments above? Thanks.

@bmscomp

bmscomp commented Jun 8, 2023

Copy link
Copy Markdown
Contributor Author

@showuon Yes I'll do ,Thanks so much @divijvaidya for reviews, I am back from holidays :) , I'll continue working on this topic, I'll check all comments one by one and try to bring the best answer possible that I'lll be able to do

Thanks again for all reviews

@bmscomp
bmscomp force-pushed the upgrade/jackson_version_to_2.15.0 branch from 66ac8b7 to 2ed8685 Compare July 16, 2023 09:04
@bmscomp bmscomp changed the title MINOR: Upgrade Jackson dependencies to version 2.15.0 MINOR: Upgrade Jackson dependencies to version 2.15.2 Jul 16, 2023
@bmscomp

bmscomp commented Jul 16, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya License file updated to mention the correct jackson version

@bmscomp

bmscomp commented Jul 16, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya The third point you mentioned
Modified handling of datetime with zone information in it. See: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15#changes-behavior-other does not affect the existing code base, it solves an issue, it's a correction of an existing bug in previous jackson version that prevent producing that kind of bugs

ZonedDateTime now = ZonedDateTime.now();
assertTrue(now.withZoneSameInstant(ZoneOffset.UTC)
        .equals(now.withZoneSameInstant(ZoneId.of("UTC"))));

I use to think that we need to write tests on json Serialization and Deserialization of zoned datetime values

@bmscomp

bmscomp commented Jul 16, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya Yes I agree with you this is not a minor change, we need to create a JIRA ticket for that

@bmscomp
bmscomp force-pushed the upgrade/jackson_version_to_2.15.0 branch from d587671 to 4d4a285 Compare July 17, 2023 21:47
@divijvaidya

Copy link
Copy Markdown
Member

Hey @bmscomp
I am waiting for an answer to the following. Please tag me again when this is ready for review.

@bmscomp could you please go through the usage of Jackson in Kafka code base and add here (similar to above) on why the new processing limits won't impact existing code (or comment if we want to increase the limits from default values).

@bmscomp

bmscomp commented Jul 18, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya I am pretty sure the introduced default values for limits wont affect the existing processing capacity, FileBasedStateStore is mainly used to store Quorum state data, and I use to think there is no need to raise the limits from default values

Since in this version:

  • Maximum number token lengths is set to 1000 as maximum number of bytes or chars that we will parse in a number
  • Maximum String value length is raised to 20_000_000 (20 million) input units bytes/chars depending on input source) in 2.15.1 and the initial value in version 2.15.0 was 5_000_000 (5 million)
  • Maximum Input nesting depth is set up to 1000 levels, and this is too huge QuorumStateData does not have as much as levels

@bmscomp bmscomp changed the title MINOR: Upgrade Jackson dependencies to version 2.15.2 KAFKA-15208: Upgrade Jackson dependencies to version 2.15.2 Jul 18, 2023
@divijvaidya divijvaidya added the backport-candidate This pull request is a candidate to be backported to previous versions label Jul 18, 2023
@bmscomp
bmscomp force-pushed the upgrade/jackson_version_to_2.15.0 branch from 4d4a285 to d1c44b0 Compare July 18, 2023 22:02
@divijvaidya

Copy link
Copy Markdown
Member

FileBasedStateStore and QuorumState are not the only place that uses jackson. Did you check usage of objectmapper, Json.scala etc. for the limits question?

@bmscomp

bmscomp commented Jul 19, 2023

Copy link
Copy Markdown
Contributor Author

@divijvaidya For the internal usage of Jackson, I can say with much confidence that the limits are far more then what is needed to run Kafka, for it's usage the message.max.bytes in Kafka it's by default 1MB, and this is also far below limits for message transformation Serialization and Deserialization

The limit not put in the message size but the attribute value size and for example String values limit is raised to 20 megabytes, and this is already huge,

Do not think it's necessary to raise those default values

@bmscomp
bmscomp force-pushed the upgrade/jackson_version_to_2.15.0 branch from d1c44b0 to f306247 Compare July 21, 2023 15:45
@divijvaidya

Copy link
Copy Markdown
Member

2.15.0 has a regression: FasterXML/jackson-databind#3968

We may want to directly want to jump to that to avoid the regression. Let's see what is the latest available version by code freeze date of 3.6 and we will merge that in.

@bmscomp
bmscomp force-pushed the upgrade/jackson_version_to_2.15.0 branch from adf612f to 5247cda Compare December 9, 2023 11:29

@mimaison mimaison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR

@mimaison

Copy link
Copy Markdown
Member

@divijvaidya Do you have any further comments?

@divijvaidya divijvaidya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some additional things that I verified:

  • JDK version supported is 8 and above.
  • scala versions 2.11 and above are supported.
  • the limits added in this version are sufficiently large for Kafka use cases. 1000 levels of nesting, 50k chars in property name and unlimited maximum content length.
  • this version upgrades dependency PCollection to 4.x, Kafka already uses 4.1 version for PCollection

Overall change looks good to me. I am waiting for CI to succeed.

@mimaison

Copy link
Copy Markdown
Member

None of the failures in the latest build seem related, merging to trunk

@mimaison
mimaison merged commit 05014ba into apache:trunk Dec 19, 2023
mimaison pushed a commit that referenced this pull request Dec 19, 2023
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
@mimaison

Copy link
Copy Markdown
Member

Backported to 3.7: 62c7e8b

gaurav-narula pushed a commit to gaurav-narula/kafka that referenced this pull request Jan 24, 2024
…3662)


Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
yyu1993 pushed a commit to yyu1993/kafka that referenced this pull request Feb 15, 2024
…3662)


Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
AnatolyPopov pushed a commit to aiven/kafka that referenced this pull request Feb 16, 2024
…3662)


Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
clolov pushed a commit to clolov/kafka that referenced this pull request Apr 5, 2024
…3662)


Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
showuon added a commit to showuon/kafka that referenced this pull request Jul 19, 2024
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 23, 2025
…3662)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 23, 2025
…3662)


Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 24, 2025
…3662)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 25, 2025
…3662)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 25, 2025
…3662)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 25, 2025
…3662)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jul 25, 2025
…3662)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
silvanli-confluent added a commit to confluentinc/kafka that referenced this pull request Jul 25, 2025
KAFKA-15208: Upgrade Jackson dependencies to version 2.16.0 (apache#13662)
silvanli-confluent added a commit to confluentinc/kafka that referenced this pull request Jul 25, 2025
KAFKA-15208: Upgrade Jackson dependencies to version 2.16.0 (apache#13662)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate This pull request is a candidate to be backported to previous versions dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants