Skip to content

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

Merged
Subodh Chaturvedi (subodh1810) merged 3 commits into
masterfrom
add-first-record-logic-mysql-cdc
Jun 2, 2021
Merged

Subodh Chaturvedi (subodh1810) merged 3 commits into
masterfrom
add-first-record-logic-mysql-cdc

Conversation

@subodh1810

@subodh1810 Subodh Chaturvedi (subodh1810) commented Jun 1, 2021 •

Copy link
Copy Markdown
Contributor

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

Subodh Chaturvedi (subodh1810) commented Jun 1, 2021 •

Copy link
Copy Markdown
Contributor Author

/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
Copy Markdown
Contributor

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

* continue to run for 5 minutes
*/
static TimeUnit sleepTimeUnit = TimeUnit.MINUTES;
private static final int SLEEP_TIME_AMOUNT = 5;

Copy link
Copy Markdown
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

Subodh Chaturvedi (subodh1810) commented Jun 1, 2021 •

Copy link
Copy Markdown
Contributor Author

/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
Subodh Chaturvedi (subodh1810) deleted the add-first-record-logic-mysql-cdc branch June 2, 2021 06:25
@avaidyanatha Abhi Vaidyanatha (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.

2 participants