Skip to content

fix: Gate internal ignore settings on remote data attributes in restore - #22570

Merged
gbbafna merged 1 commit into
opensearch-project:mainfrom
piyushk6130:fix-ignore-settings-gate-remote-publication
Jul 31, 2026
Merged

fix: Gate internal ignore settings on remote data attributes in restore#22570
gbbafna merged 1 commit into
opensearch-project:mainfrom
piyushk6130:fix-ignore-settings-gate-remote-publication

Conversation

@piyushk6130

@piyushk6130 piyushk6130 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #20494.

The internal ignore settings (index.remote_store.*) are only applied during snapshot
restore when the cluster is considered non-remote-store. This check used
isRemoteStoreAttributePresent(), which also matches remote_publication.* node
attributes. Clusters with only remote cluster state / routing table publication enabled
do not store index data remotely, but were wrongly treated as remote store clusters —
so stale index.remote_store.* settings from a snapshot (taken on a remote-store
cluster) were never stripped on restore.

Such stale settings later fail shard recovery on the restored index with
RepositoryMissingException ("Repository should be created before creating index with
remote_store enabled setting") when the referenced repositories do not exist, since
isRemoteTranslogStoreEnabled() selects the remote translog factory based on
repository-setting presence alone.

Changes:

  • Gate the internal ignore settings on isRemoteDataAttributePresent()
    (segment/translog repository attributes) instead of isRemoteStoreAttributePresent()
  • Extract the logic into a static package-private method for testability, with unit
    tests covering plain, publication-only, and remote-data clusters

Related Issues

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

Check List

  • 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.

The internal ignore settings (index.remote_store.*) are only applied
during snapshot restore when the cluster is considered non-remote-store.
This check used isRemoteStoreAttributePresent(), which also matches
remote_publication.* node attributes. Clusters with only remote cluster
state / routing table publication enabled do not store index data
remotely, but were wrongly treated as remote store clusters, so stale
remote store index settings from the snapshot were never stripped.

Such stale settings later fail shard recovery with
RepositoryMissingException when the referenced repositories do not
exist on the cluster.

Gate the internal ignore settings on isRemoteDataAttributePresent()
(segment/translog repository attributes) instead, and extract the
logic into a static method for testability.

Signed-off-by: Piyush Kumar <piykumab@amazon.com>
@piyushk6130
piyushk6130 requested a review from a team as a code owner July 27, 2026 05:07
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

✅ Gradle check result for 9abf419: SUCCESS

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.35%. Comparing base (08eb405) to head (9abf419).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #22570      +/-   ##
============================================
- Coverage     71.45%   71.35%   -0.10%     
+ Complexity    76760    76703      -57     
============================================
  Files          6136     6142       +6     
  Lines        357635   357762     +127     
  Branches      52128    52148      +20     
============================================
- Hits         255532   255296     -236     
- Misses        81755    82095     +340     
- Partials      20348    20371      +23     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gbbafna
gbbafna merged commit bacf3f6 into opensearch-project:main Jul 31, 2026
17 checks passed
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.

2 participants