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

🎉 fix-mysql-cdc: poll for 5 minutes only when we have not received a single record #3789

Merged
merged 3 commits into from Jun 2, 2021

Conversation

subodh1810
Copy link
Contributor

@subodh1810 subodh1810 commented Jun 1, 2021

Issue : #3788

In this PR #3757 we increased the poll duration from 5 seconds to 5 minutes cause 5 seconds was too low and debezium was not returning any records in that duration. This was mainly happening cause the first time the connector runs, it creates a snapshot and the snapshot creation was taking more than 5 seconds.

But now 5 minutes is too much and if a table is receiving continous insert/update/delete events within 5 minutes, the sync process would never finish.

Tested this locally against a MySQL Aurora instance

Pre-merge Checklist

  • Run integration tests
  • Publish Docker images

Recommended reading order

  1. test.java
  2. component.ts
  3. the rest

@subodh1810 subodh1810 self-assigned this Jun 1, 2021
@auto-assign auto-assign bot requested review from cgardens and jrhizor June 1, 2021 18:42
@subodh1810
Copy link
Contributor Author

subodh1810 commented Jun 1, 2021

/test connector=source-mysql

🕑 source-mysql https://github.com/airbytehq/airbyte/actions/runs/897049286
✅ source-mysql https://github.com/airbytehq/airbyte/actions/runs/897049286

Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

LGTM but one style comment

* This is not private and final because we need to override in tests otherwise each test would
* continue to run for 5 minutes
*/
static TimeUnit sleepTimeUnit = TimeUnit.MINUTES;
private static final int SLEEP_TIME_AMOUNT = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

this would 100% trip me up because I would first go: "what is the time unit for this" and then realize it's actually being used as two different constants. Could we instead make it two different constants e.g:

private static final int FIRST_RECORD_WAIT_TIME_MINUTES = 5;
private static final int SUBESQUENT_RECORD_WAIT_TIME_SECONDS = 5;

@subodh1810
Copy link
Contributor Author

subodh1810 commented Jun 1, 2021

/publish connector=connectors/source-mysql

🕑 connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/897264315
✅ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/897264315

@subodh1810 subodh1810 merged commit cbf47ad into master Jun 2, 2021
@subodh1810 subodh1810 deleted the add-first-record-logic-mysql-cdc branch June 2, 2021 06:25
@avaidyanatha avaidyanatha changed the title fix-mysql-cdc: poll for 5 minutes only when we have not received a single record 🎉 fix-mysql-cdc: poll for 5 minutes only when we have not received a single record Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants