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

fix(disrupt_terminate_and_replace_node): make it valid for gke #2810

Merged
merged 1 commit into from
Nov 19, 2020

Conversation

dkropachev
Copy link
Collaborator

This nemesis is currently failing on the GKE due to the scylla-operator issue - scylladb/scylla-operator#215

PR pre-checks (self review)

  • I followed KISS principle and best practices
  • I didn't leave commented-out/debugging code
  • I added the relevant backport labels
  • New configuration option are added and documented (in sdcm/sct_config.py)
  • I have added tests to cover my changes (Infrastructure only - under unit-test/ folder)
  • All new and existing unit tests passed (CI)
  • I have updated the Readme/doc folder accordingly (if needed)

@dkropachev dkropachev requested review from bentsi and enaydanov and removed request for bentsi October 23, 2020 11:04
@dkropachev dkropachev added Ready for review backport/none Backport is not required labels Oct 23, 2020
@dkropachev dkropachev force-pushed the gke_terminate_and_replace branch 6 times, most recently from c9c1d12 to eddb382 Compare November 2, 2020 11:23
@ghost
Copy link

ghost commented Nov 5, 2020

Congratulations 🎉. DeepCode analyzed your code in 2.434 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@dkropachev dkropachev force-pushed the gke_terminate_and_replace branch 3 times, most recently from a0bd52f to e3efc9e Compare November 6, 2020 10:23
sdcm/nemesis.py Outdated
if isinstance(self.cluster, GkeScyllaPodCluster):
terminate_method_name = random.choice(('terminate_k8s_host', 'terminate_k8s_node', 'terminate_node'))
self.log.info(f"Terminate node via {terminate_method_name}")
getattr(self.cluster, terminate_method_name)(self.target_node)
Copy link
Contributor

Choose a reason for hiding this comment

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

break into two lines

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

sdcm/nemesis.py Outdated
@@ -539,7 +540,12 @@ def _add_and_init_new_cluster_node(self, old_node_ip=None, timeout=HOUR_IN_SEC *
return new_node

def _terminate_cluster_node(self, node):
self.cluster.terminate_node(node)
if isinstance(self.cluster, GkeScyllaPodCluster):
terminate_method_name = random.choice(('terminate_k8s_host', 'terminate_k8s_node', 'terminate_node'))
Copy link
Contributor

Choose a reason for hiding this comment

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

allow terminate_node for both GKE and Minikube, raise for all other methods

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@dkropachev dkropachev force-pushed the gke_terminate_and_replace branch 2 times, most recently from d964d9c to 406883a Compare November 10, 2020 12:37
@@ -77,6 +77,10 @@ def init(self):

super().init()

@property
def instance_name(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

create on the Base class too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

no need to override it now...

@bentsi bentsi merged commit 696dc6a into scylladb:master Nov 19, 2020
@dkropachev dkropachev deleted the gke_terminate_and_replace branch July 20, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/none Backport is not required Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants