-
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
Bmoric/complete first sync #7832
Conversation
@@ -141,6 +175,7 @@ public void testFailure() throws Exception { | |||
inOrder.verify(persistence).failAttempt(JOB_ID, ATTEMPT_NUMBER); | |||
verify(jobTracker).trackSync(job, JobState.FAILED); | |||
inOrder.verifyNoMoreInteractions(); | |||
verifyNoInteractions(configRepository); |
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.
nice
...fig/persistence/src/main/java/io/airbyte/config/persistence/ValidatingConfigPersistence.java
Show resolved
Hide resolved
} | ||
|
||
}; | ||
writeConfigs(configType, configIdToConfig); | ||
database.transaction(ctx -> { |
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.
Should the rest of this be removed? Looks like it's writing twice?
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.
Thanks for the catch, it was a mistake
@@ -133,6 +140,19 @@ void submitJob(final Job job) { | |||
|
|||
if (output.getStatus() == io.airbyte.workers.JobStatus.SUCCEEDED) { | |||
persistence.succeedAttempt(job.getId(), attemptNumber); | |||
|
|||
final List<StandardWorkspace> standardWorkspaces = configRepository.listStandardWorkspaces(false); |
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.
This seems like an expensive scan. Can we just get the workspace for this specific sync job run?
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.
That would be ideal and it was my first option. How ever I never managed to access to the workspace Id here.
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
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.
job.getScope()
is the connection id for a sync, which can be used to retrieve the workspace id.
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
.collect(Collectors.toList()); | ||
|
||
configRepository.writeStandardWorkspaces(workspacesToUpdate); | ||
|
||
if (job.getConfigType() == ConfigType.SYNC) { |
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.
The above should only go in the SYNC
here. Otherwise check connection will trigger this.
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
@jrhizor The comments have been addressed. |
|
||
final OffsetDateTime timestamp = OffsetDateTime.now(); | ||
final OffsetDateTime timestamp = OffsetDateTime.now(); |
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.
this should go outside of the loop so all of the inserted records have the same timestamp for the transaction.
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
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.
one minor comment but otherwise looks good
Cool, I will merge if the build is green. |
After a sync is completed, we tag all the workspace with related to this sync as having a first sync completed. This will then be forwarded to the UI in another PR. This is part of airbytehq#5884
What
After a sync is completed, we tag all the workspace with related to this sync as having a first sync completed.
This will then be forwarded to the UI in another PR.
This is part of #5884