Hi all,

CASSANDRA-20848 upgraded jackson-core from 2.13.2 to 2.19.2 (released in
4.0.19, 4.1.10, 5.0.6).
Our JSON mapper uses Jackson's default StreamReadConstraints.
As a result, INSERT JSON and fromJson() now reject values that SELECT JSON
/ toJson() produce:
- map key with JSON text > 50,000 chars (maxNameLength). Non-text keys
  (frozen collections, tuples, UDTs, blobs) are serialized as quoted JSON,
  so nested keys reach this size quickly.
- varint/decimal > 1,000 digits (maxNumberLength)
- blob >= 10,000,000 bytes, i.e. hex string > 20M chars (maxStringLength)

Example error:
  StreamConstraintsException: Name length (50722) exceeds the maximum
allowed (50000)

This was found by the flaky AbstractTypeTest.json test:
https://ci-cassandra.apache.org/job/Cassandra-trunk/2642/testReport/junit/org.apache.cassandra.db.marshal/AbstractTypeTest/Tests___test_system_keyspace_directory_jdk21_6_20___json_system_keyspace_directory_jdk21_x86_64/

Are we OK with keeping Jackson's defaults? If so, I will fix the test to
stay within these limits.
Also, there is currently no way to change these limits without a code
change, so we probably should consider adding configuration options to
control them..

Thanks,
Dmitry

Reply via email to