Skip to content

Conversation

@KodaiD
Copy link
Contributor

@KodaiD KodaiD commented Dec 4, 2025

Description

This PR fixes the JSON serializer to increase Jackson stream read constraints, enabling the handling of large data in Object Storage adapter.

Currently, when storing a record with large data (e.g., 100MiB), Object Storage adapter fails to get the record due to the following error:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: String value length (20054016) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`) (through reference chain: 

To allow handling of large data, the PR increases the maximum allowed string length in Jackson's stream read constraints. Also, the validation that checks if the string length exceeds the maximum allowed length or not is added to the write side to prevent storing data that cannot be read back.

Related issues and/or PRs

N/A

Changes made

  • Updated he JSON serializer to increase Jackson stream read constraints.
  • Added validation on the write side to prevent storing data that cannot be read back.

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

Fix to increase the maximum allowed string length with Object Storage.

@KodaiD KodaiD self-assigned this Dec 4, 2025
@KodaiD KodaiD added the bugfix label Dec 4, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @KodaiD, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the Object Storage adapter failed to retrieve records containing large data due to strict string length constraints in the Jackson JSON serializer. By significantly increasing this limit and introducing a proactive validation step during data writes, the system can now reliably handle and store larger data payloads, preventing potential read failures and ensuring data integrity.

Highlights

  • Increased Jackson String Length Limit: The maximum allowed string length for Jackson's stream reading has been significantly increased to Integer.MAX_VALUE to accommodate larger data payloads during deserialization.
  • Write-Side Validation for Large Values: New validation logic has been introduced in ObjectStorageOperationChecker to prevent TextColumn and BlobColumn values from being written if their serialized length (including Base64 encoding for blobs) exceeds the newly defined MAX_STRING_LENGTH_ALLOWED.
  • New Error Code for Exceeded Lengths: A specific error, OBJECT_STORAGE_EXCEEDS_MAX_VALUE_LENGTH_ALLOWED, has been added to CoreError.java to clearly indicate when column values exceed the maximum allowed size during write operations.
  • Enhanced Test Coverage: Unit tests have been added to ObjectStorageOperationCheckerTest to verify the new write-side validation for TextColumn and BlobColumn. Additionally, an integration test in DistributedStorageIntegrationTestBase confirms the proper storage and retrieval of large text values.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully addresses the issue of handling large data in the Object Storage adapter by increasing Jackson's stream read constraints and adding corresponding write-side validation. The changes are logical and well-tested with both unit and integration tests. I have a few suggestions to improve the robustness and performance of the implementation. My main feedback is to replace assert statements with explicit null checks to prevent potential NullPointerExceptions at runtime. Additionally, I've suggested an optimization for an integration test to improve its performance when handling large data.

@KodaiD KodaiD marked this pull request as ready for review December 4, 2025 15:08
Copilot AI review requested due to automatic review settings December 4, 2025 15:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot finished reviewing on behalf of KodaiD December 4, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant