Skip to content

[9.4] [StorageIndexAdapter] Set auto_expand_replicas to fix yellow health on single-node ES clusters (#263096)#264262

Merged
kibanamachine merged 1 commit intoelastic:9.4from
kibanamachine:backport/9.4/commit-b805e2e7
Apr 18, 2026
Merged

[9.4] [StorageIndexAdapter] Set auto_expand_replicas to fix yellow health on single-node ES clusters (#263096)#264262
kibanamachine merged 1 commit intoelastic:9.4from
kibanamachine:backport/9.4/commit-b805e2e7

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

…n single-node ES clusters (elastic#263096)

## Summary

Fixes elastic#263048

`StorageIndexAdapter` did not include index settings in its template,
causing all 24 managed indices (`.kibana_streams`,
`.chat-conversations`, `kibana-evaluation-datasets`, etc.) to default to
`number_of_replicas: 1`. On single-node Elasticsearch clusters, the
replica shard cannot be allocated, leaving cluster health yellow
indefinitely.

This is the same class of issue as elastic#261933 (`.workflows-events`), but
affecting all indices managed by `StorageIndexAdapter`.

### Changes

- Added `settings: { auto_expand_replicas: '0-1', number_of_shards: 1 }`
to the index template in `createOrUpdateIndexTemplate()` — this is the
standard pattern used by all other Kibana system indices (`.kibana`,
`.kibana_task_manager`, event log, lock manager, blob storage, etc.)
- Added `updateSettingsOfExistingIndex()` method that checks the current
`auto_expand_replicas` value on an existing write index and updates it
to `'0-1'` if it differs — this fixes existing deployments that already
have indices with `number_of_replicas: 1`
- Wired `updateSettingsOfExistingIndex()` into
`validateComponentsBeforeWriting()` so it runs on every write to an
existing index

### Affected indices (all 24 automatically benefit)

| Plugin | Indices |
|--------|---------|
| streams (10) | `.chat-memory`, `.chat-memhistory`, `.kibana_streams`,
`.kibana_streams_settings`, `.kibana_streams_features`,
`.kibana_streams_assets`, `.kibana_streams_attachments`,
`.kibana_streams_insights`, `.kibana_streams_tasks`,
`.kibana_streams_content_packs` |
| agent_builder (10) | `.chat-conversations`, `.chat-skills`,
`.chat-tools`, `.chat-tool-health`, `.chat-plugins`,
`.chat-agent-executions`, `.chat-agents`, `.chat-sml-data`,
`.chat-sml-crawler-state`, `.chat-user-prompts` |
| evals (2) | `kibana-evaluation-datasets`,
`kibana-evaluation-dataset-examples` |
| automatic_import (1) | `.kibana-automatic-import-samples` |
| workflows_management (1) | `.workflows-workflows` |

### Test plan

- [x] Unit tests: 9 passing (3 new tests for template settings, settings
update, and no-op when already correct)
- [x] Integration tests: 20 passing (1 new test verifying existing index
gets `auto_expand_replicas` updated on next write)
- [x] Type check passes

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit b805e2e)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Apr 18, 2026
@kibanamachine kibanamachine enabled auto-merge (squash) April 18, 2026 07:47
@kibanamachine kibanamachine merged commit da43ecd into elastic:9.4 Apr 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants