-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only migrate active and disable connection #9454
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
import io.airbyte.commons.version.AirbyteVersion; | ||
import io.airbyte.config.Configs; | ||
import io.airbyte.config.EnvConfigs; | ||
import io.airbyte.config.StandardSync.Status; | ||
import io.airbyte.config.helpers.LogClientSingleton; | ||
import io.airbyte.config.init.YamlSeedConfigPersistence; | ||
import io.airbyte.config.persistence.ConfigNotFoundException; | ||
|
@@ -235,14 +236,15 @@ private static void migrateExistingConnection(final ConfigRepository configRepos | |
throws JsonValidationException, ConfigNotFoundException, IOException { | ||
LOGGER.info("Start migration to the new scheduler..."); | ||
final Set<UUID> connectionIds = | ||
configRepository.listStandardSyncs().stream().map(standardSync -> standardSync.getConnectionId()).collect(Collectors.toSet()); | ||
configRepository.listStandardSyncs().stream() | ||
.filter(standardSync -> standardSync.getStatus() == Status.ACTIVE || standardSync.getStatus() == Status.INACTIVE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reasoning behind filtering down to only ACTIVE and INACTIVE? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ACTIVE = enabled connections We need to start the enabled ones for an obvious reason. The disabled ones need to be started too so it can be re-enable later on. The workflow will await forever if it is disabled (like if it was a manual workflow). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that makes sense to me. Though we should probably get a confirmation from @jrhizor to be sure |
||
.map(standardSync -> standardSync.getConnectionId()).collect(Collectors.toSet()); | ||
temporalWorkerRunFactory.migrateSyncIfNeeded(connectionIds); | ||
LOGGER.info("Done migrating to the new scheduler..."); | ||
} | ||
|
||
/** | ||
* Copy paste from {@link io.airbyte.scheduler.app.SchedulerApp} which will be removed in a near | ||
* future | ||
* Copy paste from {@link io.airbyte.scheduler.app.SchedulerApp} which will be removed in a near future | ||
* | ||
* @param jobPersistence | ||
* @param jobNotifier | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to run
gw format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done