-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-15208: Upgrade Jackson dependencies to version 2.16.0 #13662
KAFKA-15208: Upgrade Jackson dependencies to version 2.16.0 #13662
Conversation
@divijvaidya this pull request targets an update to version 2.15.0, please can you tell me better about updating not only minor versions ? |
@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). |
@divijvaidya I get your point, thanks so much for those explanations |
It would be better to have a separate PR for clean-ups unrelated to the Jackson dependency update. |
@ijuma thank you for the comment, I'll update this pull PR and make another one for clean-ups |
3838fd2
to
950d2d5
Compare
@ijuma the PR is updated , I managed to keep only modifications related to the upgrade of |
Breaking changes between 2.13.x and 2.15.x:
@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! |
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 |
@bmscomp , could you respond to @divijvaidya 's comments above? Thanks. |
@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 |
66ac8b7
to
2ed8685
Compare
@divijvaidya License file updated to mention the correct jackson version |
@divijvaidya The third point you mentioned
I use to think that we need to write tests on json Serialization and Deserialization of zoned datetime values |
@divijvaidya Yes I agree with you this is not a minor change, we need to create a JIRA ticket for that |
d587671
to
4d4a285
Compare
Hey @bmscomp
|
@divijvaidya I am pretty sure the introduced default values for limits wont affect the existing processing capacity, Since in this version:
|
4d4a285
to
d1c44b0
Compare
|
@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 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 |
d1c44b0
to
f306247
Compare
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. |
@mimaison Thanks for the review I'll to this asap by the end of day |
ec9ac99
to
6e92864
Compare
@mimaison Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. I left a couple of questions
@@ -143,7 +143,7 @@ public class JsonConverter implements Converter, HeaderConverter, Versioned { | |||
// names specified in the field | |||
private static final HashMap<String, LogicalTypeConverter> LOGICAL_CONVERTERS = new HashMap<>(); | |||
|
|||
private static final JsonNodeFactory JSON_NODE_FACTORY = JsonNodeFactory.withExactBigDecimals(true); | |||
private static final JsonNodeFactory JSON_NODE_FACTORY = new JsonNodeFactory(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why we're making this changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mimaison Sorry I missed answering this point, the change is made because the static method is deprecated
/**
* Return a factory instance with the desired behavior for BigDecimals
* <p>See {@link #JsonNodeFactory(boolean)} for a full description.</p>
*
* @param bigDecimalExact If {code true} DISABLE normalization of {@link BigDecimal} values;
* if {code false} ENABLE normalization
* @return a factory instance with specified configuration
*
* @deprecated Use {@link com.fasterxml.jackson.databind.cfg.JsonNodeFeature#STRIP_TRAILING_BIGDECIMAL_ZEROES}
* instead for configuring behavior.
*/
@Deprecated
public static JsonNodeFactory withExactBigDecimals(boolean bigDecimalExact)
{
return new JsonNodeFactory(bigDecimalExact);
}
and the best available replacement for it is the the constructor
/**
* @param bigDecimalExact see Class description on "BigDecimal normalization"
*
* @see BigDecimal
*/
public JsonNodeFactory(boolean bigDecimalExact)
{
_cfgBigDecimalExact = bigDecimalExact;
}
LICENSE-binary
Outdated
jackson-module-jaxb-annotations-2.13.5 | ||
jackson-module-scala_2.13-2.13.5 | ||
jackson-module-scala_2.12-2.13.5 | ||
jackson-annotations-2.15.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's even a 2.16.0 release now. Is there a reason you picked 2.15.3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mimaison I know about this release I think it worth it to upgrade to it, I'll give it a try, but suppose the 2.15.3 is far stable till now
@mimaison I already upgraded to version 2.16.0 and updated the pull request |
adf612f
to
5247cda
Compare
There was a problem hiding this comment.
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
@divijvaidya Do you have any further comments? |
There was a problem hiding this comment.
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.
None of the failures in the latest build seem related, merging to trunk |
Reviewers: Mickael Maison <[email protected]>, Divij Vaidya <[email protected]>
Backported to 3.7: 62c7e8b |
…3662) Reviewers: Mickael Maison <[email protected]>, Divij Vaidya <[email protected]>
…3662) Reviewers: Mickael Maison <[email protected]>, Divij Vaidya <[email protected]>
…3662) Reviewers: Mickael Maison <[email protected]>, Divij Vaidya <[email protected]>
…3662) Reviewers: Mickael Maison <[email protected]>, Divij Vaidya <[email protected]>
Upgrade Jackson dependencies to version
2.16.0
JsonNodeFactory.withExactBigDecimals
Committer Checklist (excluded from commit message)