| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 51.46199% with 83 lines in your changes missing coverage. Please review. @@ Coverage Diff @@
## 4.22 #14609 +/- ##
============================================
+ Coverage 18.32% 18.34% +0.01%
- Complexity 16644 16665 +21
============================================
Files 5939 5939
Lines 537768 537892 +124
Branches 65929 65950 +21
============================================
+ Hits 98551 98676 +125
+ Misses 428008 427995 -13
- Partials 11209 11221 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
…tates A Kubernetes cluster's state was written by id alone, so two operations started on the same cluster at once both got past their first transition. Each then ran its steps against VMs the other was changing, and whichever finished last decided the final state. The status scanner could also overwrite the state of an operation that started after it read the cluster. The state is now compared and set in one update, as the VM and volume states are. Each operation moves the cluster into its own state before it changes anything, and fails without touching the cluster when another operation got there first. From then on it only moves the cluster while the cluster is in a state the operation moved it to. Starting a cluster in Alert now moves it to Starting like any other start. A start from Error, a stop from Created or Error, and a retried destroy still go on without a state change, as they did before; the start and stop then leave the state alone when they end. From any other state with no transition for it, an operation is now refused instead of running alongside the one that holds the cluster. The scanner only completes a stop or a recovery that it started itself. A management server that stopped during an operation left the cluster in that operation's state. Nothing moved it on, and every later operation on it was refused until the database was edited by hand. The scanner now fails the operation of a cluster in an operation's state when no job is in progress for it on any management server. The existing Alert reconciliation then returns a healthy cluster to Running. To find those jobs, the start, stop, scale and upgrade jobs now record their cluster, as the create, delete and node jobs already did. A cluster named by a job in progress on a management server of an older version, which does not record it, is left alone. This replaces the scanner's first-run handling of Starting clusters, which tried a transition that does not exist. No schema or API change. Signed-off-by: Brad House <bhouse@nexthop.ai>
|
Updated the commit (now fee9834af4) after another review pass:
KubernetesClusterResourceModifierActionWorker keeps its own copy of the start state, rather than reusing KubernetesClusterScaleWorker.originalState, to avoid conflicting with #14604, which edits those lines. mvn -pl api,plugins/integrations/kubernetes-service install passes (100 plugin unit tests, checkstyle). Still not tested on a live cluster. |
Sorry, something went wrong.
Test report: concurrent CKS operations and stuck-state recovery, on a live clusterSummary: concurrent operations are refused cleanly, and a cluster left in Upgrading or Scaling by a killed management server is recovered on the scanner's first pass. Starting a cluster in Alert holds Starting until the start ends. The recovery fixes the state only, as the description says. What the interrupted operation left behind is still there, and two of those leftovers needed a manual step. Details are below. Environment
Results
S1: concurrent operations
S2: refusals from states with no transition
S3a: management server killed during an upgrade
S3b: management server killed during a scale-up
S4: starting a cluster in Alert
Result: pass, with the main-only ISO issue and the S3b leftovers noted above.
Not covered
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Two related fixes to how a CKS cluster's state is kept.
Fixes #14608
Concurrent operations
KubernetesClusterDaoImpl.updateState wrote the state by id alone, so two operations on one cluster both got past their first transition. The workers also ignored a failed entry transition, and carried on.
Stuck states
Before this change, if a management server stopped during an operation, the async job was failed when the server came back or a peer saw it leave. The cluster stayed in Scaling, Upgrading, Starting and so on, and every later operation was refused.
No schema or API change. The binaries ISO that an interrupted operation attached is left on the VMs. The next operation's attach replaces it.
Relation to #14604
#14604 lets a cluster in Alert be scaled. It adds Alert -> Scaling transitions, which enterScalingState uses as they are. Its own check of the state when the scale worker starts still applies. This PR closes the narrow window between that check and the transition, which #14604 mentions. The two branches merge with one trivial conflict in KubernetesClusterManagerImplTest, where both add tests at the end.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
How did you try to break this feature and the system with this change?