From 24493d1c7c2ff0ffb0f6c7295ae3009a6451a146 Mon Sep 17 00:00:00 2001 From: Subodh Kant Chaturvedi Date: Tue, 16 Apr 2024 22:30:19 +0530 Subject: [PATCH] delete EnforceMutexKeyOnCreate flag (#12070) --- airbyte-featureflag/src/main/kotlin/FlagDefinitions.kt | 2 -- .../io/airbyte/workload/handler/WorkloadHandlerImpl.kt | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/airbyte-featureflag/src/main/kotlin/FlagDefinitions.kt b/airbyte-featureflag/src/main/kotlin/FlagDefinitions.kt index 357c4a09e66..57065609302 100644 --- a/airbyte-featureflag/src/main/kotlin/FlagDefinitions.kt +++ b/airbyte-featureflag/src/main/kotlin/FlagDefinitions.kt @@ -194,8 +194,6 @@ object UseWorkloadApiForDiscover : Temporary(key = "platform.use-worklo object UseWorkloadApiForSpec : Temporary(key = "platform.use-workload-api-for-spec", default = false) -object EnforceMutexKeyOnCreate : Temporary(key = "platform.enforce-mutex-key-on-create", default = false) - object ActivateRefreshes : Temporary(key = "platform.activate-refreshes", default = false) object WriteOutputCatalogToObjectStorage : Temporary(key = "platform.write-output-catalog-to-object-storage", default = false) diff --git a/airbyte-workload-api-server/src/main/kotlin/io/airbyte/workload/handler/WorkloadHandlerImpl.kt b/airbyte-workload-api-server/src/main/kotlin/io/airbyte/workload/handler/WorkloadHandlerImpl.kt index d971bea4ab9..6478d790ad6 100644 --- a/airbyte-workload-api-server/src/main/kotlin/io/airbyte/workload/handler/WorkloadHandlerImpl.kt +++ b/airbyte-workload-api-server/src/main/kotlin/io/airbyte/workload/handler/WorkloadHandlerImpl.kt @@ -1,8 +1,6 @@ package io.airbyte.workload.handler import io.airbyte.config.WorkloadType -import io.airbyte.featureflag.Connection -import io.airbyte.featureflag.EnforceMutexKeyOnCreate import io.airbyte.featureflag.FeatureFlagClient import io.airbyte.workload.api.domain.Workload import io.airbyte.workload.api.domain.WorkloadLabel @@ -27,7 +25,6 @@ class WorkloadHandlerImpl( private val featureFlagClient: FeatureFlagClient, ) : WorkloadHandler { companion object { - val UUID_ZERO: UUID = UUID.fromString("00000000-0000-0000-0000-000000000000") val ACTIVE_STATUSES: List = listOf(WorkloadStatus.PENDING, WorkloadStatus.CLAIMED, WorkloadStatus.LAUNCHED, WorkloadStatus.RUNNING) } @@ -96,7 +93,7 @@ class WorkloadHandlerImpl( // Evaluating feature flag with UUID_ZERO because the client requires a context. This feature flag is intended to be used // as a global kill switch for validation. - if (mutexKey != null && featureFlagClient.boolVariation(EnforceMutexKeyOnCreate, Connection(UUID_ZERO))) { + if (mutexKey != null) { // Keep the most recent workload by creation date with mutexKey, fail the others. workloadRepository .searchByMutexKeyAndStatusInList(mutexKey, statuses = ACTIVE_STATUSES)