Skip to content

Commit

Permalink
[PLAT-15349] Mark universe update as success after update lb config
Browse files Browse the repository at this point in the history
Summary:
The previous fix
2cc1480 did not mark
the universe update as succeeded, so the universe would always show up as Error after the task completed, even
if the task succeeded.

Test Plan: Run update_lb_config and verify the universe is green

Reviewers: nsingh, amalyshev

Reviewed By: amalyshev

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D38400
  • Loading branch information
iSignal committed Sep 25, 2024
1 parent 8db0ffb commit 44ae377
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.yugabyte.yw.commissioner.tasks;

import com.yugabyte.yw.commissioner.BaseTaskDependencies;
import com.yugabyte.yw.commissioner.UserTaskDetails.SubTaskGroupType;
import com.yugabyte.yw.common.PlacementInfoUtil;
import com.yugabyte.yw.forms.UniverseDefinitionTaskParams;
import com.yugabyte.yw.models.AvailabilityZone;
Expand Down Expand Up @@ -38,9 +39,9 @@ public void run() {
log.info("Started {} task for univ uuid={}", getName(), taskParams().getUniverseUUID());
Universe universe = getUniverse();
try {
// Update the universe DB with the changes to be performed and set the 'updateInProgress' flag
// to prevent other updates from happening.
universe = lockAndFreezeUniverseForUpdate(taskParams().expectedUniverseVersion, null);
// Lock the universe but don't freeze it because this task doesn't perform critical updates to
// universe metadata.
universe = lockUniverse(-1 /* expectedUniverseVersion */);

// Get expected LB config
Map<LoadBalancerPlacement, LoadBalancerConfig> newLbMap =
Expand All @@ -62,6 +63,9 @@ public void run() {
};
saveUniverseDetails(updater);

createMarkUniverseUpdateSuccessTasks()
.setSubTaskGroupType(SubTaskGroupType.ConfigureUniverse);

getRunnableTask().runSubTasks();
} catch (Exception e) {
log.error("Task Errored out with: " + e);
Expand Down

0 comments on commit 44ae377

Please sign in to comment.