Skip to content

Commit

Permalink
[PLAT-15101] Add runtime config to turn on/off rollN for k8s
Browse files Browse the repository at this point in the history
Summary: Added separate config entry for roll N nodes in k8s

Test Plan:
1) Create k8s universe - see rollMaxBatchSize is null in universeResp
2) Enable k8s conf - see rollMaxBatchSize is present

Reviewers: cwang

Reviewed By: cwang

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D37900
  • Loading branch information
yorq committed Sep 11, 2024
1 parent afce6ad commit 33342b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,15 @@ public class UniverseConfKeys extends RuntimeConfigKeysModule {
"yb.task.upgrade.batch_roll_enabled",
ScopeType.UNIVERSE,
"Stop multiple nodes in az simultaneously during upgrade",
"Stop multiple nodes simultaneously in az during upgrade",
"Stop multiple nodes in az simultaneously during upgrade",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> upgradeBatchRollK8sEnabled =
new ConfKeyInfo<>(
"yb.task.upgrade.batch_roll_enabled_k8s",
ScopeType.UNIVERSE,
"Stop multiple nodes in az simultaneously during upgrade (in k8s)",
"Stop multiple nodes in az simultaneously during upgrade (in k8s)",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> upgradeBatchRollAutoPercent =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ public static UniverseResp create(
Map<UUID, AllowedTasks> allowedTasks =
getAllowedTasksOnFailure(Collections.singletonList(universe));
RollMaxBatchSize rollMaxBatchSize = null;
if (confGetter.getConfForScope(universe, UniverseConfKeys.upgradeBatchRollEnabled)) {
boolean isK8s =
universe.getUniverseDetails().getPrimaryCluster().userIntent.providerType
== Common.CloudType.kubernetes;
boolean batchRollEnabled =
isK8s
? confGetter.getConfForScope(universe, UniverseConfKeys.upgradeBatchRollK8sEnabled)
: confGetter.getConfForScope(universe, UniverseConfKeys.upgradeBatchRollEnabled);
if (batchRollEnabled) {
rollMaxBatchSize = UpgradeTaskBase.getMaxNodesToRoll(universe);
}
return new UniverseResp(
Expand Down
1 change: 1 addition & 0 deletions managed/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ yb {

upgrade {
batch_roll_enabled = false
batch_roll_enabled_k8s = false
batch_roll_auto_percent = 0
batch_roll_auto_number = 0
}
Expand Down

0 comments on commit 33342b3

Please sign in to comment.