Repository navigation
Reject deleted or scaled-to-zero workloads and unschedulable pods in mitigation eval - #209
Open
Nazmus Sakib (TheDeadcoder) wants to merge 1 commit into
Open
Nazmus Sakib (TheDeadcoder) wants to merge 1 commit into
Nazmus Sakib (TheDeadcoder) wants to merge 1 commit into
Conversation
Author
@microsoft-github-policy-service agree |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #208
What this changes
pods_unhealthy_reasonsno longer skips them, unless the pod finished successfully. This matchesKubeCtl._pod_is_ready_or_succeeded.MitigationTask.record_deployed_workloadsrecords every Deployment and StatefulSet and its replica count.Orchestrator.init_problemcalls it right afterapp.deploy()and beforeinject_fault().wait_until_pods_healthynow checks this on every poll, inside the same settle window.misconfig_app_hotel_res,wrong_bin_usage,redeploy_without_pvandscale_pod_social_netnow callwait_until_pods_healthy. They keep their own extra checks. They also get the settle window from Add a bounded settle window to mitigation recovery eval #180.kafka_queue_problemsnow also requires thekafkaQueueProblemsflag to beoffagain. This uses a newOtelFaultInjector.get_flag_variant.KubeCtl.list_deploymentsandKubeCtl.list_stateful_sets.Why the record is safe
The record stores each workload's configured replica count. Kubernetes sets this as soon as the app is deployed. So the record does not depend on pods being ready yet.
If a task never records its workloads, eval behaves exactly as before.
Tests
tests/orchestrator/test_mitigation_settle.py. They cover a pod stuck inPending, a deleted workload, a workload scaled to 0, a restored workload, a workload deployed with 0 replicas, a task with no record, and the kafka flag on and off.pytest tests --ignore=tests/integrationbefore and after this change. The same 22 tests fail both times, because they need a live cluster. All new tests pass.Live check
I ran all 14 mitigation problems on a kind cluster, before and after this change. After each action, I polled eval for 120 seconds, the same window AIOpsLab uses by default.
recover_fault()Notes on the table:
assign_to_non_existent_nodeandkafka_queue_problemsnow fail.redeploy_without_PVandmisconfig_app_hotel_resstill pass. These two are listed under "Not covered" below.kafka_queue_problemsnow fails, because the flag is still on.recover_fault()that now fails isredeploy_without_PV. Itsrecover_fault()callsapp.cleanup(), which deletes the application. So after it, the namespace has no Deployments at all. The old check passed because there were no pods left to check. The new check fails because every recorded Deployment is gone. This looks like a separate problem in that task's recovery, not in this change.Not covered
redeploy_without_PV: data loss does not show in pod state.misconfig_app_hotel_res: eval can still pass before the crash shows up.