Skip to content

Commit

Permalink
fix(Elasticsearch): Add un-drain of the node if timeout is reached dr…
Browse files Browse the repository at this point in the history
…aining it
  • Loading branch information
dfradehubs committed Dec 19, 2024
1 parent 2f6049e commit 9730141
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/elasticsearch/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ func waitForNodeRemoval(ctx *v1alpha1.Context, es *elasticsearch.Client, nodeNam
log.Printf("Error sending Slack notification: %v", err)
}
}

// Add node again to the cluster settings
err = ClearElasticsearchClusterSettings(ctx, nodeName)
if err != nil {
return fmt.Errorf("error clearing cluster settings: %w", err)
}

return fmt.Errorf("timeout trying to remove node from cluster settings in elasticsearch: %v", ctxWithTimeout.Err())
default:
// Get _cat/shards to check if nodeName has any shard inside
Expand Down

0 comments on commit 9730141

Please sign in to comment.