Skip to content
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

Merged

Conversation

andriikorotkov
Copy link
Contributor

@andriikorotkov andriikorotkov commented Oct 14, 2022

What

Skip CHECKs steps if previous sync success

How

First sync:
2022-10-14_17-52

Second success sync after first success sync:
2022-10-14_17-54

Second sync (first failure attempt) after first success sync:
2022-10-14_18-00

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 =)):
2022-10-14_18-00_1

Second success sync after first failure sync:
2022-10-14_18-07

Recommended reading order

  1. 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

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added area/platform issues related to the platform area/worker Related to worker labels Oct 14, 2022
@andriikorotkov andriikorotkov changed the title Skip CHECKs steps if connection success Skip CHECKs steps if previous sync success Oct 14, 2022
@andriikorotkov andriikorotkov linked an issue Oct 14, 2022 that may be closed by this pull request
@andriikorotkov
Copy link
Contributor Author

All I have to do is add new ones and update some existing tests.

Copy link
Contributor

@evantahler evantahler left a 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);
Copy link
Contributor

@evantahler evantahler Oct 14, 2022

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?

Copy link
Contributor Author

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.

2022-10-17_11-03

@andriikorotkov andriikorotkov marked this pull request as ready for review October 17, 2022 14:01
…13459_skip_checks_steps_if_connecton_success
@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 17, 2022 14:05 Inactive
@evantahler
Copy link
Contributor

Removing myself from the PR review and adding some folks from the Platform Workflow team

@evantahler evantahler requested review from benmoriceau and gosusnp and removed request for evantahler October 17, 2022 15:28
if (isResetJob(sourceLauncherConfig) || checkFailure.isFailed()) {
final JobCheckFailureInput jobStateInput =
new JobCheckFailureInput(Long.parseLong(jobRunConfig.getJobId()), jobRunConfig.getAttemptId().intValue(), connectionId);
var isLastJobOrAttemptFailure = jobCreationAndStatusUpdateActivity.isLastJobOrAttemptFailure(jobStateInput);
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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)

@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 19, 2022 11:52 Inactive
…13459_skip_checks_steps_if_connecton_success

� Conflicts:
�	airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java
@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 19, 2022 12:29 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 19, 2022 12:53 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 19, 2022 15:06 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 19, 2022 16:32 Inactive
Copy link
Contributor

@benmoriceau benmoriceau left a 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
@andriikorotkov andriikorotkov temporarily deployed to more-secrets October 20, 2022 07:13 Inactive
@andriikorotkov andriikorotkov merged commit e62c3c3 into master Oct 20, 2022
@andriikorotkov andriikorotkov deleted the akorotkov/13459_skip_checks_steps_if_connecton_success branch October 20, 2022 09:26
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only run CHECKs after a failing Sync attempt
3 participants