You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SO Migrations] Check cluster routing allocation when creating new indices (#225965)
## Summary
Resolves#222539
Add new states to check that `cluster.routing.allocation.enable` has a
valid value to create a new index before trying to do so.
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
### Identify risks
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
7. If there is a new indices migrators (e.g. .kibana_alerting_cases). Check cluster routing allocation
237
+
and reindex (this is dead code and should be removed)
238
+
239
+
## CREATE_INDEX_CHECK_CLUSTER_ROUTING_ALLOCATION
240
+
241
+
### Next action
242
+
243
+
`checkClusterRoutingAllocationEnabled`
244
+
245
+
Check that replica allocation is enabled from cluster settings (`cluster.routing.allocation.enabled`). Migrations will fail when replica allocation is disabled during the bulk index operation that waits for all active shards. Migrations wait for all active shards to ensure that saved objects are replicated to protect against data loss.
246
+
247
+
The Elasticsearch documentation mentions switching off replica allocation when restoring a cluster and this is a setting that might be overlooked when a restore is done. Migrations will fail early if replica allocation is incorrectly set to avoid adding a write block to the old index before running into a failure later.
248
+
249
+
If replica allocation is set to 'all', the migration continues to fetch the saved object indices.
250
+
251
+
### New control state
252
+
253
+
1. If `cluster.routing.allocation.enabled` has a compatible value.
230
254
231
255
→ [CREATE_NEW_TARGET](#create_new_target)
232
256
257
+
2. If it has a value that will not allow creating new *saved object* indices.
@@ -579,6 +607,28 @@ Set a write block on the source index to prevent any older Kibana instances from
579
607
580
608
→ [CREATE_REINDEX_TEMP](#create_reindex_temp)
581
609
610
+
## RELOCATE_CHECK_CLUSTER_ROUTING_ALLOCATION
611
+
612
+
### Next action
613
+
614
+
`checkClusterRoutingAllocationEnabled`
615
+
616
+
Check that replica allocation is enabled from cluster settings (`cluster.routing.allocation.enabled`). Migrations will fail when replica allocation is disabled during the bulk index operation that waits for all active shards. Migrations wait for all active shards to ensure that saved objects are replicated to protect against data loss.
617
+
618
+
The Elasticsearch documentation mentions switching off replica allocation when restoring a cluster and this is a setting that might be overlooked when a restore is done. Migrations will fail early if replica allocation is incorrectly set to avoid adding a write block to the old index before running into a failure later.
619
+
620
+
If replica allocation is set to 'all', the migration continues to fetch the saved object indices.
621
+
622
+
### New control state
623
+
624
+
1. If `cluster.routing.allocation.enabled` has a compatible value.
625
+
626
+
→ [CREATE_REINDEX_TEMP](#create_reindex_temp)
627
+
628
+
2. If it has a value that will not allow creating new *saved object* indices.
0 commit comments