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

[Mysql] Apply initial setup time to Debezium setup time #32662

Merged
merged 18 commits into from Nov 28, 2023

Conversation

xiaohansong
Copy link
Contributor

@xiaohansong xiaohansong commented Nov 17, 2023

Fix https://github.com/airbytehq/oncall/issues/3567

Some DB has large number of tables to sync. In that case, our default 5 minutes wait time is not enough. The change is to make initial setup time defined by user also applies to that default debezium setup time if it's larger.

What

Describe what the change is solving
It helps to add screenshots if it affects the frontend.

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user?

For connector PRs, use this section to explain which type of semantic versioning bump occurs as a result of the changes. Refer to our Semantic Versioning for Connectors guidelines for more information. Breaking changes to connectors must be documented by an Airbyte engineer (PR author, or reviewer for community PRs) by using the Breaking Change Release Playbook.

If there are breaking changes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Actions

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • 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.
  • Connector version is set to 0.0.1
    • Dockerfile has version 0.0.1
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog with an entry for the initial version. See changelog example
    • docs/integrations/README.md

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.
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

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.
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:generateScaffolds then checking in your changes
  • Documentation which references the generator is updated as needed
Updating the Python CDK

Airbyter

Before merging:

  • Pull Request description explains what problem it is solving
  • Code change is unit tested
  • Build and my-py check pass
  • Smoke test the change on at least one affected connector
    • On Github: Run this workflow, passing --use-local-cdk --name=source-<connector> as options
    • Locally: airbyte-ci connectors --use-local-cdk --name=source-<connector> test
  • PR is reviewed and approved

After merging:

  • Publish the CDK
    • The CDK does not follow proper semantic versioning. Choose minor if this the change has significant user impact or is a breaking change. Choose patch otherwise.
    • Write a thoughtful changelog message so we know what was updated.
  • Merge the platform PR that was auto-created for updating the Connector Builder's CDK version
    • This step is optional if the change does not affect the connector builder or declarative connectors.

Copy link

vercel bot commented Nov 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2023 5:22pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Nov 17, 2023
@@ -55,6 +55,7 @@ public class JdbcUtils {
public static final String TLS_KEY = "tls";
public static final String USERNAME_KEY = "username";
public static final String MODE_KEY = "mode";
public static final String ENGINE_WARMUP_MINUTE_KEY = "engine_warmup_minute";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we adding this to the spec as a user configured option? IMO maybe we shouldn't present this option to the user as it might be confusing to have 2 timeouts.

We already provide the initial record waiting time option to the user. What we can do is :

  1. Have logic that defaults the minimum value to 5 min (current time)
  2. If the user has defined the initial wait time > 5 min, we can set it to that.

What do you think? Also what was the new time that worked for the OC issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that sounds good! I was thinking just to add that so in our backend we could adjust this in oncall operations; but I think your proposal makes more sense.

In the OC issue the timeout was 9 minutes 30 seconds; so adjusting initial wait time should work

@octavia-squidington-iii octavia-squidington-iii added the area/connectors Connector related issues label Nov 27, 2023
if (Duration.between(engineStartTime, Instant.now()).compareTo(Duration.ofMinutes(5L)) > 0) {
LOGGER.error("No record is returned even after 5 minutes of waiting, closing the engine");
final Duration initialWaitingDuration = database.getSourceConfig().has(INITIAL_WAITING_SECONDS) ? Duration
.ofSeconds(database.getSourceConfig().get(INITIAL_WAITING_SECONDS).asLong()) : Duration.ofMinutes(5L);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just to not change the minimum default (since we were seeing some timeouts), we should take the max (5 min, user_configured_first_wait_time)

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 call - fixed!

@@ -53,6 +53,7 @@
public class MySqlDebeziumStateUtil implements DebeziumStateUtil {

private static final Logger LOGGER = LoggerFactory.getLogger(MySqlDebeziumStateUtil.class);
private static final String INITIAL_WAITING_SECONDS = "initial_waiting_seconds";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : can we reuse the method RecordWaitTimeUtil.getFirstRecordWaitSeconds() instead of re-read this?

Copy link
Contributor

@akashkulk akashkulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving - one small nit about PR description + changelog comment : I think that you should mention that initial wait time is already configurable - but this is extending the wait time to read schema history from Debezium

@xiaohansong xiaohansong changed the title [Mysql] Make initial setup time configurable [Mysql] Apply initial setup time to Debezium setup time Nov 28, 2023
@xiaohansong
Copy link
Contributor Author

xiaohansong commented Nov 28, 2023

/publish-java-cdk

🕑 https://github.com/airbytehq/airbyte/actions/runs/7012762143
✅ Successfully published Java CDK version=0.5.1!

@xiaohansong xiaohansong enabled auto-merge (squash) November 28, 2023 17:44
@xiaohansong xiaohansong merged commit d7c8f35 into master Nov 28, 2023
24 checks passed
@xiaohansong xiaohansong deleted the xiaohan/waittime branch November 28, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation CDK Connector Development Kit connectors/source/mysql connectors/source/mysql-strict-encrypt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants