OpenSearch: [BUG] Shards stuck initializing
Describe the bug
13 shards are still stuck in ‘initializing’ 3 hours after node restart (single node cluster)
Initially this caused all indices to be unavailable until I increased cluster.routing.allocation.node_initial_primaries_recoveries to 20
I can not find any logs or other information to try and debug this issue, any guidance would be appreciated.
os.cluster.allocation_explain(body={
'index': '.opensearch-sap-windows-detectors-queries-000020',
'shard': 0,
'primary': True,
})
{
"index": ".opensearch-sap-windows-detectors-queries-000020",
"shard": 0,
"primary": true,
"current_state": "initializing",
"unassigned_info": {
"reason": "CLUSTER_RECOVERED",
"at": "2024-02-20T20:50:34.536Z",
"last_allocation_status": "throttled"
},
"current_node": {
"id": "8ocPYpOtSwWVbXiyJtAPQA",
"name": "opensearch-node1",
"transport_address": "172.19.0.2:9300",
"attributes": {
"shard_indexing_pressure_enabled": "true"
}
},
"explanation": "the shard is in the process of initializing on node [opensearch-node1], wait until initialization has completed"
}
Related component
Other
To Reproduce
I have no idea.
We have a single node cluster and enabled windows detectors yesterday. Nothing but trouble since then.
Expected behavior
Cluster should be able to restart and have all indices come back online. At minimum there should be logging and or timeouts when recovering indices.
Additional Details
OpenSearch 2.11.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 15 (7 by maintainers)
@mvanderlee Thanks for reaching out offline on the slack, I’ve taking a look at the logs.
I get a picture of the cluster state with the following exception - it looks like the SecurityAnalytics plugin (see messages with SecurityAnalyticsException.java ) & alerting plugin (see messages with DestinationMigrationCoordinator ) is in a very tight request/retry loop that is trying to fetch data and being rejected because there are too many requests in flight and there is too much memory in use (see messages with SearchBackpressureService ) - from the inner cause rejection the completed tasks number is 25M items.
You can troubleshoot further by using the
_cat/tasksAPI to find any long running tasks and_cat/pending_tasksAPI to see what long running tasks, maybe this can point to a specific operation that is stuck/hogging resources that can be canceled/cleared. If you can afford to play around with the configuration starting up the service with some plugins disabled might help let the startup phase success and then onboard ism, then alerting, then other plugins.I’d recommend troubleshooting those errors by looking at with forum.opensearch.org. It seems like there could be a ‘task’ explosion due to the index management plugin or one of the other plugins.
This is the bounds of my expertise - best of luck.
@peternied I ran into this again with opensearch operator, looks like it restart nodes too quickly and this causes unrecoverable split-brain problem. Currently I have cluster with 2 nodes, but I saw this on 3 node cluster.
Logs
3h+ stuck in recovery of 5kb index
GET /_cluster/allocation/explain?pretty
@mvanderlee Thanks for taking a look, sounds like an ugly issue. Reach out to me, @ Peter Nied, on our Slack instance - https://opensearch.org/slack.html we can discuss next steps.
@peternied
AWS Linux 2 on EC2 r5.4xlarge dockerized deployment, via docker-compose.
All we did was enable a windows detector in security analytics. We then noticed memory issues, so increased the EC2 instance. When it stayed unavailable I investigated and ended up finding 4
.opensearch-sap-windows-detectors-queries-xxxxxindices stuck ininitializing. After I increased thenode_initial_primaries_recoveriesto 20, there were 13 stuck. In total there were 66.opensearch-sap-windows-detectors-queries-xxxxxindices and the stuck ones were not in numerical order. This happened twice in a row (we started at r5.xlarge, then r5.2xlarge, then r5.4xlarge)