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

[source-mssql/mysql/postgres] Fix and cleanup oc map #42024

Merged
merged 24 commits into from
Jul 22, 2024
Merged

Conversation

xiaohansong
Copy link
Contributor

What

https://github.com/airbytehq/oncall/issues/5825

We need to pre-populate all ocInfo or pkInfo to state manager.

In case like this:

We have 2 resumable full refreshes. It failed when we are syncing the 1st one. The final state would be like
{stream: A, streamState: { ...(detailed state)... } }
{stream: B, streamState: null }

The next time it load, with previous logic, it will only load for pkInfo(ocInfo) for stream A. When we run load records for stream B, pkInfo or ocInfo would be null. That is confirmed by the added test.

How

Added a test to cover this. There are some cdk traffic about error message and wass interface change - I just stubbed them. will wait them to merge before checking this in.

Review guide

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@xiaohansong xiaohansong requested review from a team as code owners July 16, 2024 23:51
Copy link

vercel bot commented Jul 16, 2024

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 Jul 22, 2024 5:56pm

@theyueli
Copy link
Contributor

@xiaohansong
Copy link
Contributor Author

@xiaohansong , also fixes this airbytehq/airbyte-internal-issues#8560 ?

Yes - thanks for linking that! I'll update details in that ticket.

@theyueli theyueli changed the title [source-mssql/mysql] Fix and cleanup oc map [source-mssql/mysql/postgres] Fix and cleanup oc map Jul 17, 2024
@@ -159,7 +159,7 @@ public static boolean isSavedOffsetStillPresentOnServer(final JdbcDatabase datab
AirbyteTraceMessageUtility.emitAnalyticsTrace(cdcCursorInvalidMessage());
if (!sourceConfig.get("replication_method").has(INVALID_CDC_CURSOR_POSITION_PROPERTY) || sourceConfig.get("replication_method").get(
INVALID_CDC_CURSOR_POSITION_PROPERTY).asText().equals(FAIL_SYNC_OPTION)) {
throw new ConfigErrorException(
throw new ConfigErrorException("test",
Copy link
Contributor

Choose a reason for hiding this comment

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

"test" left on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yeah just to bypass the compile error when I draft this PR. I'll revert this!

@@ -41,7 +41,13 @@ public void updatePrimaryKeyLoadState(final AirbyteStreamNameNamespacePair pair,

// Returns the previous state emitted, represented as a {@link PrimaryKeyLoadStatus} associated with
// the stream.
public abstract PrimaryKeyLoadStatus getPrimaryKeyLoadStatus(final AirbyteStreamNameNamespacePair pair);
public PrimaryKeyLoadStatus getPrimaryKeyLoadStatus(final AirbyteStreamNameNamespacePair pair) {
if (pairToPrimaryKeyLoadStatus.containsKey(pair)) {
Copy link
Contributor

@rodireich rodireich Jul 19, 2024

Choose a reason for hiding this comment

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

simply doing get() does the same thing, no?

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 you are right... I was paranoid that this was null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

@xiaohansong
Copy link
Contributor Author

/publish-java-cdm

@xiaohansong
Copy link
Contributor Author

xiaohansong commented Jul 22, 2024

/publish-java-cdk

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

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Jul 22, 2024
@xiaohansong xiaohansong merged commit af28105 into master Jul 22, 2024
39 checks passed
@xiaohansong xiaohansong deleted the xiaohan/ocinfo branch July 22, 2024 18:32
xiaohansong added a commit that referenced this pull request Jul 23, 2024
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
Co-authored-by: btkcodedev <btk.codedev@gmail.com>
Co-authored-by: Artem Inzhyyants <36314070+artem1205@users.noreply.github.com>
Co-authored-by: Natik Gadzhi <natik@respawn.io>
Co-authored-by: artem1205 <artem1205@users.noreply.github.com>
Co-authored-by: Augustin <augustin@airbyte.io>
Co-authored-by: Antonio Papa <antoniogpapa@gmail.com>
Co-authored-by: Adam Marcus <marcua@marcua.net>
Co-authored-by: Bryce Groff <bgroff@hawaii.edu>
Co-authored-by: Akash Kulkarni <113392464+akashkulk@users.noreply.github.com>
Co-authored-by: Patrick Nilan <nilan.patrick@gmail.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/mssql connectors/source/mysql connectors/source/postgres
Projects
None yet
Development

Successfully merging this pull request may close these issues.