-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Skip CHECKs steps if previous sync success #17999
Skip CHECKs steps if previous sync success #17999
Conversation
…vious attempt is failure
…13459_skip_checks_steps_if_connecton_success
All I have to do is add new ones and update some existing tests. |
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! I think you are well on the right path. Learning about Temporal is tricky - well done!
configTypes.add(SYNC); | ||
|
||
try { | ||
List<Job> jobList = jobPersistence.listJobsIncludingId(configTypes, input.getConnectionId().toString(), input.getJobId(), limit); |
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.
To confirm: limit will query SQL for 2 rows, but are we ordering by the right thing to get the most recent 2 attempts?
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.
Good question. Judging by the way the structure of the method for obtaining jobs is built, the first request will be to get OffsetDateTime of creation of an active job. With the second request, we will receive the number of jobs whose creation date is greater than or equal to the result of the first request. Since we make a request with the identifier of the last active job, the number we will receive from the second request will always be 1. And then, during the calculation, we will receive the number of jobs that will be returned to us for processing - this will be calculated based on the result of the second request, and the limit we passed to this request - the result will always be 2.
…13459_skip_checks_steps_if_connecton_success
Removing myself from the PR review and adding some folks from the Platform Workflow team |
if (isResetJob(sourceLauncherConfig) || checkFailure.isFailed()) { | ||
final JobCheckFailureInput jobStateInput = | ||
new JobCheckFailureInput(Long.parseLong(jobRunConfig.getJobId()), jobRunConfig.getAttemptId().intValue(), connectionId); | ||
var isLastJobOrAttemptFailure = jobCreationAndStatusUpdateActivity.isLastJobOrAttemptFailure(jobStateInput); |
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.
You need to create a new workflow version here. Otherwise it will make the running workflow to fail when this is being deploy. The workflow version is a temporal internal functionality that ensure compatibility between an old running version of this workflow and the new one you are trying to introduce. You canfind an example of the usage of such a version on line 287 in the report success function. I will be happy to pair on this if needed.
Another issue here is that you need to wrap your activity code in the runMandatoryActivityWithOutput
function. This is needed to ensure that we don't block the workflow is this activity fails for any reason.
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.
I believe that for the version comment the test WorkflowReplayingTest
should fail as of 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.
@benmoriceau, I added the changes you posted above. But I'm not sure if I did it right because I failed to update the version correctly. Please review my pull request again and if I'm doing something wrong, tell me what I should add and change. (I'm working with temporal for the first time, and I may be wrong in something)
…13459_skip_checks_steps_if_connecton_success � Conflicts: � airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java
...kers/src/main/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowImpl.java
Outdated
Show resolved
Hide resolved
...kers/src/main/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowImpl.java
Outdated
Show resolved
Hide resolved
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.
LGTM, let's wait for the build to pass to make sure that the workflowReplayerTest is passing.
…13459_skip_checks_steps_if_connecton_success
* Disabled CHECKs for source and destination, when previous sync or previous attempt is failure * added tests and added minor changes to the isLastJobOrAttemptFailure method * updated remarks * updated code style * updated code style * fixed remarks * fixed remarks
What
Skip CHECKs steps if previous sync success
How
First sync:
Second success sync after first success sync:
Second sync (first failure attempt) after first success sync:
Second sync (second success attempt) after first failure attempt (Please do not look at changing some of the logs, I just forgot to put them back when I took the screenshots =)):
Second success sync after first failure sync:
Recommended reading order
x.java
🚨 User Impact 🚨
Skip CHECKs steps if previous sync success
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.