Users can only upgrade successfully to Elasticsearch 9.x if all indices in their system were created in 8.x. This means any index created in a 7.x version or older must be reindexed into an 8.x format for the upgrade to succeed.
For instance, we need to reindex the .kibana_security_session_1 index if it was created in a 7.x format (server-side sessions have been available since 7.10).
Currently, we have a .kibana_security_session alias pointing to the .kibana_security_session_1 index. We create this index manually to maintain control over its settings. Additionally, if the index exists but has outdated mappings, we need to update them, which can be done using alias. When system index reindexing is triggered from the Upgrade Assistant, Elasticsearch will need to:
Create a new index with a different name (e.g., .kibana_security_session_1_reindexed)
Reindex all documents from .kibana_security_session_1 into it
Update the .kibana_security_session alias to point to the new index, and
Drop the old .kibana_security_session_1 index
Given this process, we need to update our code in session_index.ts to:
Detect whether .kibana_security_session_1 or the reindexed index exists (maybe just check if search against alias returns non-404 result?)
Attempt to create .kibana_security_session_1 only if neither exists, and
Update mappings using .kibana_security_session alias if needed.
Summary
Users can only upgrade successfully to Elasticsearch 9.x if all indices in their system were created in 8.x. This means any index created in a 7.x version or older must be reindexed into an 8.x format for the upgrade to succeed.
For instance, we need to reindex the
.kibana_security_session_1
index if it was created in a 7.x format (server-side sessions have been available since 7.10).Currently, we have a
.kibana_security_session
alias pointing to the.kibana_security_session_1
index. We create this index manually to maintain control over its settings. Additionally, if the index exists but has outdated mappings, we need to update them, which can be done using alias. When system index reindexing is triggered from the Upgrade Assistant, Elasticsearch will need to:.kibana_security_session_1_reindexed
).kibana_security_session_1
into it.kibana_security_session
alias to point to the new index, and.kibana_security_session_1
indexGiven this process, we need to update our code in session_index.ts to:
.kibana_security_session_1
or the reindexed index exists (maybe just check if search against alias returns non-404 result?).kibana_security_session_1
only if neither exists, and.kibana_security_session
alias if needed.