Skip to content

Conversation

@rakshit98
Copy link
Contributor

Description

If the index settings have remote store repositories configured and remote store is not enabled in the cluster, wrong translog repository is being chosen because of missing validation.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • [ Y ] Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
📝 Walkthrough

Walkthrough

The change adds a prerequisite to the isRemoteTranslogStoreEnabled() method in IndexSettings, requiring the index to be assigned on a remote node in addition to having a configured remote translog repository. A corresponding test validates this behavior.

Changes

Cohort / File(s) Summary
Core Logic
server/src/main/java/org/opensearch/index/IndexSettings.java
Modified isRemoteTranslogStoreEnabled() condition to require remote node assignment; now returns true only if remoteStoreTranslogRepository is non-null/non-empty AND isAssignedOnRemoteNode() is true
Tests
server/src/test/java/org/opensearch/index/IndexSettingsTests.java
Added testRemoteTranslogStoreDisabledWhenNodeHasNoRemoteStoreAttributes() to verify remote translog remains disabled when node lacks remote store attributes, even with configured repository

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding validation to prevent incorrect translog repository selection when there's a disparity between index and node settings.
Description check ✅ Passed The description section clearly explains the issue being fixed. The checklist shows testing was included. However, the related issues section is incomplete with placeholder text.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Contributor

❌ Gradle check result for 47bcdef: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for 475fc7d: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for 98ec407: 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?

@rakshit98 rakshit98 force-pushed the main branch 2 times, most recently from e85e645 to 43cbba9 Compare January 28, 2026 07:48
Signed-off-by: Andriy Redko <drreta@gmail.com>
Signed-off-by: Rakshit Goyal <irakshg@amazon.com>
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.

3 participants