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

Postgres source: check if Debezium is active #13208

Closed
tuliren opened this issue May 25, 2022 · 6 comments
Closed

Postgres source: check if Debezium is active #13208

tuliren opened this issue May 25, 2022 · 6 comments
Labels

Comments

@tuliren
Copy link
Contributor

tuliren commented May 25, 2022

Tell us about the problem you're trying to solve

  • Currently we wait for Debezium to start processing the relevant logs without a timeout. The timeout is 5 minutes.
  • This approach does not work in two ways.
    1. Sometimes Debezium has too many processed logs to go through. So 5 minutes is not enough.
    2. The connector will always wait for Debezium for 5 minutes even when there is no data to sync. This is unnecessary overhead for data syncing. Also it slows down the integration test significantly. For now, the whole Postgres source integration test take 40minutes to one hour.

Describe the solution you’d like

  • From the logs, we know that Debezium usually starts very quickly. From my local observation, it only takes 17 seconds. When Debezium is active, it actively emits logs informing us what it is doing.
  • If we can somehow get the information from Debezium, we don't need a hardcoded timeout. We can simply check whether Debezium is still active or not.
    • The check can either be listening to changes in the state file, or calling a Debezium API about its latest status, if such an API exists.
  • If it is possible, reduce the timeout from 5 minutes to 1 minute.

Describe the alternative you’ve considered or used

N/A

Additional context

N/A

@tuliren
Copy link
Contributor Author

tuliren commented Jun 2, 2022

Connect to MySQL RDS CDC can be 1-2 minutes. The 5 minutes timeout is inspired by MySQL, not Postgres.

@grishick
Copy link
Contributor

grishick commented Jul 6, 2022

Next steps:

  • Move this back into backlog
  • file an issue to log LSN diff
  • file an issue to wait while Debezium is making a snapshot

Other options to consider: add this feature to Debezium

@grishick
Copy link
Contributor

Going to postpone this for now, because there is no non-hacky implementation path for this at this point.

@tuliren
Copy link
Contributor Author

tuliren commented Jul 21, 2022

Created a Debezium issue here: https://issues.redhat.com/browse/DBZ-5432

@grishick grishick added the team/db-dw-sources Backlog for Database and Data Warehouse Sources team label Sep 27, 2022
@bleonard
Copy link
Contributor

Hopeful for this approach #15040

@rodireich
Copy link
Contributor

This should be resolved by #15040 / #18987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants