Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug logs to monitor retry in waitForEmptyEsNode #422

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion operator/es_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,13 @@ func (c *ESClient) waitForEmptyEsNode(ctx context.Context, pod *v1.Pod) error {
default:
// Process response as normal if context is not done.
var shards []ESShard
err := json.Unmarshal(r.Body(), &shards)
body := r.Body()
c.logger().Debugf("Request to %s/_cat/shards?h=index,ip&format=json status code %d - %s on %s/%s (%s)",
c.Endpoint.String(), r.StatusCode(), string(body[:]), pod.Namespace, pod.Name, podIP)
hooseins marked this conversation as resolved.
Show resolved Hide resolved
err := json.Unmarshal(body, &shards)
if err != nil {
c.logger().Debugf("Error unmarshalling ES shards on %s/%s (%s) - %v",
pod.Namespace, pod.Name, podIP, err)
return true, err
}
// shardIP := make(map[string]bool)
Expand All @@ -382,6 +387,8 @@ func (c *ESClient) waitForEmptyEsNode(ctx context.Context, pod *v1.Pod) error {
if remainingShards > 0 {
err = c.excludePodIP(pod)
if err != nil {
c.logger().Debugf("Error with excluding pod ip on %s/%s (%s) - %v",
pod.Namespace, pod.Name, podIP, err)
return true, err
}
}
Expand Down
Loading