Skip to content

Conversation

@Gautam-aman
Copy link

@Gautam-aman Gautam-aman commented Dec 3, 2025

Description

This PR registers the s3.client.<client>.disable_chunked_encoding setting in the repository-s3 plugin.

Currently, configuring the setting in opensearch.yml such as:

s3.client.default.disable_chunked_encoding: true

results in a startup failure : unknown setting [s3.client.default.disable_chunked_encoding]

even though DISABLE_CHUNKED_ENCODING is defined in S3ClientSettings and supported at repository level.

Root Cause : 
DISABLE_CHUNKED_ENCODING was not included in the list returned by S3RepositoryPlugin#getSettings(), so the setting was never registered as a valid node setting.

Fix:
Added S3ClientSettings.DISABLE_CHUNKED_ENCODING to S3RepositoryPlugin#getSettings().
Added a test assertion in S3RepositoryPluginTests#testGetExecutorBuilders to ensure the setting is registered.

Testing
./gradlew :plugins:repository-s3:check passes successfully.

Impact : 
Users can now safely configure s3.client.default.disable_chunked_encoding in opensearch.yml for S3-compatible storage that does not support AWS chunked encoding (e.g., Oracle Object Storage, MinIO, Ceph, Cloudflare R2, etc.).


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * S3 chunked-encoding configuration is now exposed as a repository setting.

* **Tests**
  * Tests updated to cover the newly exposed setting.

* **Other**
  * Internal equality/hash behavior adjusted with no user-facing API or behavior changes.

<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@Gautam-aman Gautam-aman requested a review from a team as a code owner December 3, 2025 18:27
@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

Added S3ClientSettings.DISABLE_CHUNKED_ENCODING to the plugin settings list, added a unit-test assertion for its presence, and adjusted S3ClientSettings.equals/hashCode to include maxSyncConnections and use primitive comparison for disableChunkedEncoding.

Changes

Cohort / File(s) Summary
Plugin Settings Exposure
plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java
Added S3ClientSettings.DISABLE_CHUNKED_ENCODING to the list returned by getSettings() (inline comment added).
Test Coverage
plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java
Added an assertion in testGetExecutorBuilders to verify S3ClientSettings.DISABLE_CHUNKED_ENCODING is present in the plugin settings.
Equality & Hashing
plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java
Modified equals() to compare disableChunkedEncoding as a primitive boolean and added maxSyncConnections to equals()/hashCode() computations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check the new setting entry and inline comment in S3RepositoryPlugin.java.
  • Verify the test assertion style and coverage in S3RepositoryPluginTests.java.
  • Confirm equals() and hashCode() changes in S3ClientSettings.java correctly reflect field types and remain consistent.

Poem

🐰 I nudged a flag into the sunlit bin,
A boolean hop, a tiny win,
The test gave a nod, the hashes aligned,
I twitch my nose—new order defined. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: registering the disable_chunked_encoding setting in repository-s3 node settings, which aligns with the primary objective of the PR.
Description check ✅ Passed The description includes all key sections: a clear description of what the change achieves, explanation of the root cause, the fix applied, testing confirmation, and impact statement. However, it lacks explicit reference to a related issue number in the 'Related Issues' section.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d42f07 and 068a2bd.

📒 Files selected for processing (3)
  • plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java (3 hunks)
  • plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java (1 hunks)
  • plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: gradle-check
🔇 Additional comments (2)
plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java (1)

78-79: LGTM! Good test coverage for the setting registration.

The assertion correctly verifies that DISABLE_CHUNKED_ENCODING is included in the plugin's registered settings, which validates the main objective of this PR.

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java (1)

676-676: LGTM! Critical equals/hashCode contract fixes.

These changes fix important bugs in the equals/hashCode implementation:

  1. Line 676: Adding maxSyncConnections comparison to equals() fixes a critical bug where instances with different maxSyncConnections values would incorrectly be considered equal.

  2. Line 684: Using primitive comparison (==) for disableChunkedEncoding is more idiomatic than Objects.equals() since it's a primitive boolean field.

  3. Line 703: Adding maxSyncConnections to hashCode() ensures the equals/hashCode contract is maintained.

These fixes are essential for correct behavior when S3ClientSettings instances are used in hash-based collections.

Also applies to: 684-684, 703-703


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java (1)

78-79: Keep the assertion, but avoid PR-specific comment wording

The new assertion correctly verifies that DISABLE_CHUNKED_ENCODING is registered in the plugin settings. The inline comment (“New assertion for your bug fix”) is tied to this PR and doesn’t convey long-term intent; consider either removing it or replacing it with something descriptive like “ensure DISABLE_CHUNKED_ENCODING is registered as a node setting”.

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java (1)

366-367: Setting registration is correct; clean up the inline bug-fix comment

Including S3ClientSettings.DISABLE_CHUNKED_ENCODING in getSettings() is the right fix to register this node setting. The comment “Fixed the bug in this line” is tied to this PR and doesn’t describe behavior; consider removing it or replacing it with a brief description of what the setting does (e.g., that it controls disabling HTTP chunked encoding for S3 clients).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7f013f and bfa670a.

📒 Files selected for processing (2)
  • plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java (1 hunks)
  • plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java (1 hunks)

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

❌ Gradle check result for bfa670a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Gautam-aman Gautam-aman force-pushed the fix-disable-chunked-encoding branch from bfa670a to 217b8b7 Compare December 3, 2025 19:03
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java (1)

366-368: DISABLE_CHUNKED_ENCODING registration is correct; consider cleaning up the comment

The addition of S3ClientSettings.DISABLE_CHUNKED_ENCODING to getSettings() is exactly what’s needed for the node setting to be registered; behavior-wise this looks good.

The inline comment // Fixed the bug in this line is not very descriptive and will age quickly. I’d either drop it or replace it with a comment about what the setting does instead of the historical note.

For example, to just remove the historical comment:

-            S3ClientSettings.SIGNER_OVERRIDE,
-            // Fixed the bug in this line
-            S3ClientSettings.DISABLE_CHUNKED_ENCODING,
+            S3ClientSettings.SIGNER_OVERRIDE,
+            S3ClientSettings.DISABLE_CHUNKED_ENCODING,

Or, if you want a descriptive comment:

-            S3ClientSettings.SIGNER_OVERRIDE,
-            // Fixed the bug in this line
-            S3ClientSettings.DISABLE_CHUNKED_ENCODING,
+            S3ClientSettings.SIGNER_OVERRIDE,
+            // Allows disabling AWS SDK chunked encoding for S3-compatible storage
+            S3ClientSettings.DISABLE_CHUNKED_ENCODING,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfa670a and 217b8b7.

📒 Files selected for processing (2)
  • plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java (1 hunks)
  • plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: gradle-check

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

❌ Gradle check result for 217b8b7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Gautam-aman Gautam-aman force-pushed the fix-disable-chunked-encoding branch from 217b8b7 to 8d42f07 Compare December 4, 2025 04:39
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

❌ Gradle check result for 8d42f07: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

… settings

Signed-off-by: Aman Gautam <amangautam2128@gmail.com>
@Gautam-aman Gautam-aman force-pushed the fix-disable-chunked-encoding branch from 8d42f07 to 068a2bd Compare December 4, 2025 05:17
@Gautam-aman
Copy link
Author

CI didn't start due to a Jenkins trigger 403 / jq parsing error.
Requesting to retrigger gradle-check manually. Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

❌ Gradle check result for 068a2bd: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Gautam-aman
Copy link
Author

I ran the suite locally via ./gradlew :plugins:repository-s3:internalClusterTest and it passes successfully.

The CI failure appears to be due to the Jenkins trigger issue (403 / jq parsing).
Requesting maintainers to manually retrigger gradle-check. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant