Skip to content

Ensure jackson default maximums introduced in 2.16.0 do not conflict with OpenSearch settings #11278

@cwperks

Description

@cwperks

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

Metadata

Metadata

Assignees

Labels

enhancementEnhancement or improvement to existing feature or requestv2.12.0Issues and PRs related to version 2.12.0v3.0.0Issues and PRs related to version 3.0.0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions