diff options
Diffstat (limited to 'orchestrator')
2 files changed, 9 insertions, 11 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java index e3989fd86d4..87e7fa31796 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java @@ -5,7 +5,6 @@ import com.yahoo.config.provision.Zone; import com.yahoo.vespa.applicationmodel.ClusterId; import com.yahoo.vespa.applicationmodel.ServiceType; import com.yahoo.vespa.flags.BooleanFlag; -import com.yahoo.vespa.flags.FetchVector; import com.yahoo.vespa.flags.FlagSource; import com.yahoo.vespa.flags.Flags; import com.yahoo.vespa.orchestrator.model.ClusterApi; @@ -18,26 +17,22 @@ import static com.yahoo.vespa.orchestrator.policy.HostedVespaPolicy.ENOUGH_SERVI public class HostedVespaClusterPolicy implements ClusterPolicy { - private final BooleanFlag groupSuspensionFlag; + private final BooleanFlag groupSuspensionInPermanentSuspendFlag; private final Zone zone; public HostedVespaClusterPolicy(FlagSource flagSource, Zone zone) { // Note that the "group" in this flag refers to hierarchical groups of a content cluster. - this.groupSuspensionFlag = Flags.GROUP_SUSPENSION.bindTo(flagSource); + this.groupSuspensionInPermanentSuspendFlag = Flags.GROUP_SUSPENSION_IN_PERMANENT_SUSPEND.bindTo(flagSource); this.zone = zone; } @Override public SuspensionReasons verifyGroupGoingDownIsFine(ClusterApi clusterApi) throws HostStateChangeDeniedException { - boolean enableContentGroupSuspension = groupSuspensionFlag - .with(FetchVector.Dimension.APPLICATION_ID, clusterApi.getApplication().applicationId().serializedForm()) - .value(); - if (clusterApi.noServicesOutsideGroupIsDown()) { return SuspensionReasons.nothingNoteworthy(); } - int percentageOfServicesAllowedToBeDown = getConcurrentSuspensionLimit(clusterApi, enableContentGroupSuspension).asPercentage(); + int percentageOfServicesAllowedToBeDown = getConcurrentSuspensionLimit(clusterApi, true).asPercentage(); if (clusterApi.percentageOfServicesDownIfGroupIsAllowedToBeDown() <= percentageOfServicesAllowedToBeDown) { return SuspensionReasons.nothingNoteworthy(); } @@ -69,7 +64,10 @@ public class HostedVespaClusterPolicy implements ClusterPolicy { return; } - int percentageOfServicesAllowedToBeDown = getConcurrentSuspensionLimit(clusterApi, false).asPercentage(); + boolean enableContentGroupSuspension = groupSuspensionInPermanentSuspendFlag.value(); + + int percentageOfServicesAllowedToBeDown = getConcurrentSuspensionLimit(clusterApi, enableContentGroupSuspension) + .asPercentage(); if (clusterApi.percentageOfServicesDownIfGroupIsAllowedToBeDown() <= percentageOfServicesAllowedToBeDown) { return; } diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java index 237d418aae5..cd703dad97f 100644 --- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java +++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java @@ -124,7 +124,7 @@ public class ClusterApiImplTest { "Services down on resumed hosts: [1 missing config server].")); } - flagSource.withBooleanFlag(Flags.GROUP_SUSPENSION.id(), true); + flagSource.withBooleanFlag(Flags.GROUP_SUSPENSION_IN_PERMANENT_SUSPEND.id(), true); try { policy.verifyGroupGoingDownIsFine(clusterApi); @@ -156,7 +156,7 @@ public class ClusterApiImplTest { "Services down on resumed hosts: [1 missing config server host].")); } - flagSource.withBooleanFlag(Flags.GROUP_SUSPENSION.id(), true); + flagSource.withBooleanFlag(Flags.GROUP_SUSPENSION_IN_PERMANENT_SUSPEND.id(), true); try { policy.verifyGroupGoingDownIsFine(clusterApi); |