-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
In jackson
2.16.0 new settings were added to configure maximum nesting on output and maximum field length on input. OpenSearch already has 2 settings for similar behavior:
public static final Setting<Long> INDEX_MAPPING_DEPTH_LIMIT_SETTING = Setting.longSetting(
"index.mapping.depth.limit",
20L,
1,
Property.Dynamic,
Property.IndexScope
);
public static final Setting<Long> INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING = Setting.longSetting(
"index.mapping.field_name_length.limit",
Long.MAX_VALUE,
1L,
Property.Dynamic,
Property.IndexScope
);
Its possible that a user could configure the OpenSearch settings with values that exceed the maximums from Jackson, in which case, the Jackson defaults would supersede the OpenSearch settings. I'm capturing an issue to track whether OpenSearch should allow a user to configure a cluster to exceed the Jackson maximums.
It may be possible to update the XContent Parsers to configure StreadReadConstraints and StreamWriteConstraints which is already configured for 50mb max document size: https://github.com/opensearch-project/OpenSearch/blob/main/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContent.java#L81