Skip to main content

Startup behaviour

Connection URL validation​

Before any OpenSearch call is made, jeap.opensearch.indexwriter.connection.url is validated while the configuration properties are initialized. An invalid URL fails the startup with an error naming the property instead of surfacing later as a connection error. A URL without a scheme is interpreted as https, and http is rejected when signing-region is set. See the Configuration reference for the accepted formats.

Index operations​

On startup, IndexMappingUpdater iterates over every registered IndexTypeDescriptor and calls ensureIndexReady for each one. This performs two operations against OpenSearch: creating or updating the index template, and validating or updating the mapping on the current write index.

1. Index template​

For each IndexType, before mutating its template or mapping, the writer checks deployed physical-index analysis and field assignments against the requested definition. It rejects incompatible analysis and mapping version downgrades for that IndexType. IndexTypes are processed independently and sequentially; a later failure does not roll back changes already applied to an earlier IndexType. This requires settings-read permission; see Native analysis.

The service creates and manages the index template itself. After compatibility checks, on every startup it applies the template via PUT, creating it if it does not exist or overwriting it if it does. The template always contains the current mapping, optional IndexType-owned native analysis, the configured shard/replica/refresh settings, the read alias, and the ISM rollover alias setting — regardless of whether any ISM policy is actually attached. By default no policy is attached, so the write alias simply stays on the one physical index indefinitely; see Index lifecycle for when and how to opt into rollover instead.

The template name is derived from the write alias by stripping the _write suffix:

Write aliasTemplate nameIndex pattern
jme_decree_document_v1_writejme_decree_document_v1jme_decree_document_v1-*
precious_registration_v1_writeprecious_registration_v1precious_registration_v1-*

Template settings are looked up under jeap.opensearch.indexwriter.index-templates.<templateName> (template name without _write), falling back to the default entry. If neither is present, startup fails with a clear error.

Why the write alias is not in the template: When ISM performs a rollover it creates the new partition from the template. If the template contained the write alias, the new partition would receive it immediately — while the old one still holds it — causing OpenSearch to reject the rollover with "Rollover alias can point to multiple indices, found duplicated alias". The write alias is set explicitly only when the initial physical index is created, and is then owned exclusively by ISM.

Settings changes and existing partitions: Changes to number-of-shards, number-of-replicas, and refresh-interval are written to the template on every startup but only take effect for new partitions created by ISM rollover. Existing partitions are not affected. Compatible mapping changes are applied to the template and current physical write index on startup. Older rollover partitions are checked for analysis compatibility but their mappings are not updated.

2. Index mapping on existing physical indices​

After updating the template, the service resolves the physical write index pointed to by the write alias and checks the _meta.schema_version stored in its mapping. The write index is the one carrying is_write_index: true on the alias; if no index carries that flag (older setups with a single physical index), the single physical index is used.

ConditionAction
Write alias does not existCreate initial physical index {base}-000001 with write alias (is_write_index: true). The template automatically applies settings and the read alias.
Mapping version matches current minor versionNo action — index is left untouched.
Mapping version differsPush updated mapping to the write index via PUT /{physicalIndex}/_mapping.
OpenSearch returns cluster_block_exception (e.g. disk flood-stage watermark)Log a warning and continue startup — the mapping update is applied on the next startup once the block is removed.

Maintenance job target policy check​

The ISM policy check of maintenance job targets does not run at startup; it runs once when a job is created. See Maintenance job target policy check.