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

[Part 1 ] : Hackday project to debug connections #33027

Merged
merged 14 commits into from
Dec 12, 2023
Merged

Conversation

akashkulk
Copy link
Contributor

@akashkulk akashkulk commented Dec 1, 2023

This is the Java part of the debug hack project. Specifically

  • Creates an DebugUtil utility debug class
  • Created an example debugger associated w/Postgres
  • Added debug hooks to ensure that every run does not modify source DB state (ack LSNs, etc)

Next steps :

  • Create debuggers for all certified connectors
  • Cleanup scripts & playbook for the other flows

Copy link

vercel bot commented Dec 1, 2023

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

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2023 0:31am

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/source/postgres labels Dec 1, 2023
Copy link
Contributor

github-actions bot commented Dec 1, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

Copy link
Contributor

github-actions bot commented Dec 1, 2023

Coverage report for source-postgres

File Coverage [86.95%] 🍏
PostgresCdcCtidInitializer.java 89.1% 🍏
PostgresUtils.java 85.27% 🍏
Total Project Coverage 71.71% 🍏

Copy link
Contributor

@postamar postamar left a comment

Choose a reason for hiding this comment

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

You may reasonably think I'm being needlessly annoying in this review. With respect to the narrow scope of this particular change I absolutely am and I'm sorry. My interest here is to question old habits in matters of java code style, which I strongly feel need to change. We need to care more about readability. This PR happens to be greenfield development so the discussion feels warranted on my end, unlike a change involving legacy code. cc @stephane-airbyte who, I think, feels the same way about this stuff.

Wrt the review of this change in particular, having part 2 up would help me understand part 1 better.

throw new RuntimeException("WARNING: config indicates that we are clearing the WAL log while reading data. This will mutate the WAL log"
+ " associated with the source being debugged and is not advised.");
}
final JsonNode debugConfig = ((ObjectNode) originalConfig.deepCopy()).put("debug_mode", true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason why we couldn't simply decree that debug_mode be used/reserved in all connectors for this purpose? I have the feeling that this line + the isDebugMode method are going to be copy-pasted a lot otherwise.

@akashkulk
Copy link
Contributor Author

You may reasonably think I'm being needlessly annoying in this review. With respect to the narrow scope of this particular change I absolutely am and I'm sorry. My interest here is to question old habits in matters of java code style, which I strongly feel need to change. We need to care more about readability. This PR happens to be greenfield development so the discussion feels warranted on my end, unlike a change involving legacy code. cc @stephane-airbyte who, I think, feels the same way about this stuff.

Wrt the review of this change in particular, having part 2 up would help me understand part 1 better.

Not at all - I appreciate the comments! I will go through these and address them. As far as Part 2 goes, that is mainly a script not related to these efforts. There is also a small follow-up which creates debuggers for MongoDb, MySql, MsSql based on the patterns established in this PR so rather part 1 will dictate how part 2 will look like.

@akashkulk
Copy link
Contributor Author

I ended up rewriting a large chunk of it. I incorparated a lot of feedback from @postamar.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Add a section on how to use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm planning on doing a detailed write up. For now, I'm just hoping to get this in

@@ -15,7 +15,7 @@ java {
airbyteJavaConnector {
cdkVersionRequired = '0.5.3'
features = ['db-sources']
useLocalCdk = false
useLocalCdk = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to change back 💁‍♂️

@akashkulk
Copy link
Contributor Author

akashkulk commented Dec 11, 2023

/publish-java-cdk

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

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Dec 12, 2023
@akashkulk akashkulk merged commit f827af1 into master Dec 12, 2023
25 of 26 checks passed
@akashkulk akashkulk deleted the akash/lsn-investigate branch December 12, 2023 01:21
@postamar
Copy link
Contributor

Thanks for applying the suggestions @akashkulk and sorry for not circling back but it's all good. Much appreciated!

rishabh-cldcvr pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Dec 14, 2023
Co-authored-by: akashkulk <akashkulk@users.noreply.github.com>
tmathew0309 pushed a commit to tmathew0309/airbyte that referenced this pull request Jan 12, 2024
Co-authored-by: akashkulk <akashkulk@users.noreply.github.com>
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/postgres
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants