Skip to content

Commit

Permalink
[Backport 2.18][PLAT-11056] YBC isn't stopped and deleted in OnPremDe…
Browse files Browse the repository at this point in the history
…stroyInstancesMethod

Summary:
Stop the YBC process running on the nodes in three different workflows where this was missed earlier:
  # AddOnClusterDelete
  # EditUniverse
  # ReadOnlyClusterDelete

Also made changes to clean up the ybc-data directory and the YBC logs directory.

Original PR: https://phorge.dev.yugabyte.com/D31850
Original commit: 2750461

Test Plan:
   # Repro the issue
  # Made the required changes in EditUniverse and then verified that the ybc was not running after the change
  # Same as above tested the change for ReadOnlyClusterDelete task.
  # Manually verified that the ybc-data directory and the YBC logs directory is deleted.
  # Added the deleted onprem node to an universe and verified that YBC is running
  # Test the changes on a cron based universe and verified that YBC resources are cleanedup
  # Verified that the script is working correctly for a non-YBC universe too

Reviewers: sanketh, cwang, vkumar

Reviewed By: sanketh

Subscribers: yugaware

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D31884
  • Loading branch information
vpatibandla-yb committed Jan 25, 2024
1 parent 3f10e0c commit ca96e67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions managed/devops/opscli/ybops/cloud/onprem/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ def callback(self, args):
self.update_ansible_vars_with_args(args)

# First stop both tserver and master processes.
processes = ["tserver", "master"]
processes = ["tserver", "master", "controller"]
logging.info(("[app] Running control script to stop " +
"against master and tserver at {}").format(host_info['name']))
"against master, tserver and controller at {}").format(host_info['name']))
self.cloud.run_control_script(processes[0], "stop", args, self.extra_vars, host_info)
self.cloud.run_control_script(processes[1], "stop", args, self.extra_vars, host_info)
self.cloud.run_control_script(processes[2], "stop", args, self.extra_vars, host_info)

# Revert the force using of user yugabyte.
args.ssh_user = ssh_user
Expand All @@ -183,7 +184,7 @@ def callback(self, args):
args.ssh_user = "yugabyte"
self.update_ansible_vars_with_args(args)
logging.info(("[app] Running control script to clean and clean-logs " +
"against master and tserver at {}").format(host_info['name']))
"against master, tserver and controller at {}").format(host_info['name']))
for process in processes:
for command in ["clean", "clean-logs"]:
self.cloud.run_control_script(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ clean_data_paths() {
if [ "$daemon" == "tserver" ]; then
rm -rf "${MOUNT_PATHS[i]}"/pg_data
fi

if [ "$daemon" == "controller" ]; then
rm -rf "${MOUNT_PATHS[i]}"/ybc-data
fi
done

print_err_out "Cleaning core files on `hostname`"
Expand Down

0 comments on commit ca96e67

Please sign in to comment.