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

Check for hostError and automaticRestart when test finishes. #71456

Merged
merged 1 commit into from
Nov 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions cluster/log-dump/log-dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,30 @@ function dump_nodes_with_logexporter() {
fi
}

function detect_node_failures() {
if ! [[ "${gcloud_supported_providers}" =~ "${KUBERNETES_PROVIDER}" ]]; then
return
fi

detect-node-names
for group in "${INSTANCE_GROUPS[@]}"; do
local creation_timestamp=$(gcloud compute instance-groups managed describe \
"${group}" \
--project "${PROJECT}" \
--zone "${ZONE}" \
--format='value(creationTimestamp)')
echo "Failures for ${group}"
gcloud logging read --order=asc \
--format='table(timestamp,jsonPayload.resource.name,jsonPayload.event_subtype)' \
--project "${PROJECT}" \
"resource.type=\"gce_instance\"
logName=\"projects/${PROJECT}/logs/compute.googleapis.com%2Factivity_log\"
(jsonPayload.event_subtype=\"compute.instances.hostError\" OR jsonPayload.event_subtype=\"compute.instances.automaticRestart\")
jsonPayload.resource.name:\"${group}\"
timestamp >= \"${creation_timestamp}\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great.
My only question here is - what is the estimation on the time it takes to run this command? This pretty much goes over activity log on all nodes, which for 5k-node clusters may be quite a lot.
Did you try running that on larger clusters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes ~20 seconds per instance group. So approx. 1 minute for all of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - thanks.

done
}

function main() {
setup
# Copy master logs to artifacts dir locally (through SSH).
Expand All @@ -447,6 +471,8 @@ function main() {
echo "Dumping logs from nodes locally to '${report_dir}'"
dump_nodes
fi

detect_node_failures
}

main