Skip to content

Commit

Permalink
[PLAT-14315] [k8s] Make disk increase task independent of the univers…
Browse files Browse the repository at this point in the history
…e health

Summary: Added logic to skip prechecks for k8s universe disk update task (as there is no other way to fix broken universe)

Test Plan:
1) run disk update on k8s universe
verify no precheck tasks created

2) Stop tserver manually in k8s universe
run resize node and verify it is successful

Reviewers: hzare, anijhawan

Reviewed By: anijhawan

Subscribers: anijhawan, yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D40509
  • Loading branch information
yorq committed Dec 24, 2024
1 parent 949dca8 commit 9142970
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ protected boolean isBlacklistLeaders() {
return getOrCreateExecutionContext().isBlacklistLeaders();
}

@Override
protected boolean isSkipPrechecks() {
return taskParams().skipNodeChecks;
}

@Override
protected void createPrecheckTasks(Universe universe) {
MastersAndTservers nodesToBeRestarted = getNodesToBeRestarted();
log.debug("Nodes to be restarted {}", nodesToBeRestarted);
if (taskParams().upgradeOption == UpgradeOption.ROLLING_UPGRADE
&& nodesToBeRestarted != null
&& !nodesToBeRestarted.isEmpty()) {
&& !nodesToBeRestarted.isEmpty()
&& !isSkipPrechecks()) {
Optional<NodeDetails> nonLive =
nodesToBeRestarted.getAllNodes().stream()
.filter(n -> n.state != NodeDetails.NodeState.Live)
Expand All @@ -92,7 +98,7 @@ protected void createPrecheckTasks(Universe universe) {

@Override
protected void addBasicPrecheckTasks() {
if (isFirstTry()) {
if (isFirstTry() && !isSkipPrechecks()) {
verifyClustersConsistency();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ protected boolean isBlacklistLeaders() {
return false; // TODO: Modify blacklist is disabled by default for k8s now for some reason.
}

protected boolean isSkipPrechecks() {
return false;
}

public static class KubernetesPlacement {
public PlacementInfo placementInfo;
public Map<UUID, Integer> masters;
Expand Down Expand Up @@ -1035,10 +1039,12 @@ public void upgradePodsTask(
final List<NodeDetails> nodeList = partition.nodeList;
final List<String> podNames = partition.podNames;
for (NodeDetails node : nodeList) {
createNodePrecheckTasks(
node, serverTypes, SubTaskGroupType.ConfigureUniverse, true, softwareVersion);
if (!isSkipPrechecks()) {
createNodePrecheckTasks(
node, serverTypes, SubTaskGroupType.ConfigureUniverse, true, softwareVersion);
}
}
if (!isReadOnlyCluster) {
if (!isReadOnlyCluster && !isSkipPrechecks()) {
createCheckNodesAreSafeToTakeDownTask(
Collections.singletonList(
UpgradeTaskBase.MastersAndTservers.from(nodeList, serverTypes)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ protected ResizeNodeParams taskParams() {
return (ResizeNodeParams) taskParams;
}

@Override
protected boolean isSkipPrechecks() {
return true;
}

@Override
public void run() {
try {
Expand All @@ -59,7 +64,6 @@ public void run() {
taskParams().expectedUniverseVersion, null /* Txn callback */);
taskParams().useNewHelmNamingStyle = universe.getUniverseDetails().useNewHelmNamingStyle;
preTaskActions();
addBasicPrecheckTasks();

// String softwareVersion = userIntent.ybSoftwareVersion;
// primary and readonly clusters disk resize
Expand Down

0 comments on commit 9142970

Please sign in to comment.