From f05e6022bf414e78cbbe4fec2fb1b73c42219dcd Mon Sep 17 00:00:00 2001 From: Asher Feldman Date: Tue, 19 Sep 2017 13:12:13 -0700 Subject: [PATCH] feat(redis_migration): log if there are still pending orchestrations/pipelines (#1626) --- ...RedisOrchestrationMigrationNotificationAgent.groovy | 10 ++++++++-- ...MultiRedisPipelineMigrationNotificationAgent.groovy | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisOrchestrationMigrationNotificationAgent.groovy b/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisOrchestrationMigrationNotificationAgent.groovy index 9d267e67b3..4fc9e6603a 100644 --- a/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisOrchestrationMigrationNotificationAgent.groovy +++ b/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisOrchestrationMigrationNotificationAgent.groovy @@ -110,14 +110,20 @@ class MultiRedisOrchestrationMigrationNotificationAgent extends AbstractPollingN allApplications.eachWithIndex { Application application, int index -> def applicationName = application.name.toLowerCase() - def migratableOrchestrations = executionRepositoryPrevious + def unmigratedOrchestrations = executionRepositoryPrevious .retrieveOrchestrationsForApplication(applicationName, executionCriteria) - .filter({ orchestration -> orchestration.status.isComplete() && !previouslyMigratedOrchestrationIds.contains(orchestration.id) }) + .filter({ orchestration -> !previouslyMigratedOrchestrationIds.contains(orchestration.id) }) .toList() .toBlocking() .single() + def migratableOrchestrations = unmigratedOrchestrations.findAll { it.status.isComplete() } + def pendingOrchestrations = unmigratedOrchestrations.findAll { !it.status.isComplete() } + if (migratableOrchestrations.isEmpty()) { + if (!pendingOrchestrations.isEmpty()) { + log.info("${pendingOrchestrations.size()} orchestrations yet to complete ${applicationName}) [${index}/${allApplications.size()}]") + } return } diff --git a/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisPipelineMigrationNotificationAgent.groovy b/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisPipelineMigrationNotificationAgent.groovy index 96f687615c..3d0c79611d 100644 --- a/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisPipelineMigrationNotificationAgent.groovy +++ b/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/migrations/MultiRedisPipelineMigrationNotificationAgent.groovy @@ -107,14 +107,20 @@ class MultiRedisPipelineMigrationNotificationAgent extends AbstractPollingNotifi log.info("Found ${allPipelineConfigIds.size()} pipeline configs") allPipelineConfigIds.eachWithIndex { String pipelineConfigId, int index -> - def migratablePipelines = executionRepositoryPrevious + def unmigratedPipelines = executionRepositoryPrevious .retrievePipelinesForPipelineConfigId(pipelineConfigId, executionCriteria) - .filter({ pipeline -> pipeline.status.isComplete() && !previouslyMigratedPipelineIds.contains(pipeline.id) }) + .filter({ pipeline -> !previouslyMigratedPipelineIds.contains(pipeline.id) }) .toList() .toBlocking() .single() + def migratablePipelines = unmigratedPipelines.findAll { it.status.isComplete() } + def pendingPipelines = unmigratedPipelines.findAll { !it.status.isComplete() } + if (migratablePipelines.isEmpty()) { + if (!pendingPipelines.isEmpty()) { + log.info("${pendingPipelines.size()} pipelines yet to complete (${pipelineConfigId}) [${index}/${allPipelineConfigIds.size()}]") + } return }