Skip to content

Reject explicitly empty index store type - #22551

Open
HUSTERGS wants to merge 2 commits into
opensearch-project:mainfrom
HUSTERGS:fix/empty_store_type
Open

Reject explicitly empty index store type#22551
HUSTERGS wants to merge 2 commits into
opensearch-project:mainfrom
HUSTERGS:fix/empty_store_type

Conversation

@HUSTERGS

Copy link
Copy Markdown
Contributor

Description

Explicitly setting index.store.type to an empty string currently bypasses the registered directory factory lookup. The create-index request is acknowledged, but shard creation later fails with no matching store type for [], leaving the index red.

This change distinguishes an omitted store type from an explicitly configured empty value:

  • When index.store.type is absent, the internal empty default continues to select the default directory factory.
  • When index.store.type is explicitly set to "", it enters the existing directory factory lookup and fails with IllegalArgumentException: Unknown store type [].
  • Valid built-in and plugin-provided store types are unaffected.

The failure occurs while creating the temporary IndexService, before the index is added to the cluster state.

This change adds an internal-cluster test verifying that an explicitly empty store type is rejected during index creation.

Validation performed:

./gradlew :server:internalClusterTest \
  --tests "org.opensearch.action.admin.indices.create.CreateIndexIT.testExplicitEmptyStoreTypeIsRejected"

./gradlew :server:test \
  --tests "org.opensearch.index.IndexModuleTests"

./gradlew :server:spotlessJavaCheck

Related Issues

Resolves #22550

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.

Signed-off-by: gesong.samuel <gesong.samuel@bytedance.com>
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 0c7ecbe)

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

PR Code Suggestions ✨

@github-actions github-actions Bot added the Other label Jul 23, 2026
Signed-off-by: gesong.samuel <gesong.samuel@bytedance.com>
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 0c7ecbe

@github-actions

Copy link
Copy Markdown
Contributor

❌ Gradle check result for 0c7ecbe: 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?

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

Labels

bug Something isn't working Other

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Explicit empty index.store.type creates an unusable red index

1 participant