Skip to content

fix(source-intercom): use state for parent stream requests and use global state #57524

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

Merged
merged 4 commits into from
Apr 10, 2025

Conversation

brianjlai
Copy link
Contributor

@brianjlai brianjlai commented Apr 8, 2025

What

I was investigating a couple of suspicious failures as a result of when #53187 was originally released. The failing syncs couldn't be replicated locally, but my changes put our connector more in line with how it previously worked

regression tests to follow

How

I noticed that on the original release, we forgot to indicate on the conversation_parts stream that state should be passed when making the parent stream request to incrementally get parent records. We did this on the deprecated custom component and might be the reason for the hanging syncs.

Also, upon inspecting the manifest more, we should also be using global_substream_cursor because the previous implementation did not require tracking per-parent state management.

I also noticed that we were having a few issues w/ hanging syncs on substreams. This is because the arbitrary/custom state that intercom used to write since the custom cursor used to write doesn't fit quite how our actual concurrent cursors work. Concurrent per-partition state requires parent state be under parent_state.conversations. I added a state migration to copy the parent state to parent_state.conversations which fixed the issue so we use incoming state to reduce the amount of parent records fetched.

Review guide

  1. manifest.yaml

User Impact

Should be none, but the underlying state format might look a little different

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Apr 8, 2025

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 Apr 9, 2025 11:11pm

@brianjlai
Copy link
Contributor Author

brianjlai commented Apr 9, 2025

regression test results:
https://github.com/airbytehq/airbyte/actions/runs/14367791213/job/40284726039

analyzing results:

  • There is a catalog mismatch, I'm not too concerned about this, between what is in prod 0.12.2 the previously paused rollout, and this one, there were some CDK version bumps and my changes are unrelated
  • There is a 2 record mismatch, I attribute this to a time drift in between control vs candidate runs. The stream is relatively high volume. I've tested the conversation_parts stream locally since my changes affect it and it shouold be working as expected
  • All other stream counts line up.

intercom_regression_tests

@brianjlai
Copy link
Contributor Author

brianjlai commented Apr 9, 2025

/approve-regression-tests see above comment about results

Check job output.

✅ Approving regression tests

Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -661,6 +662,7 @@ definitions:
cursor_datetime_formats:
- "%s"
is_client_side_incremental: true
global_substream_cursor: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Confirming that this is done cause there are usually so many conversations that we assume we will hit the per partition limit and therefore we're fine with having a global state.

Benefits:

  • Easier to understand state

Drawback:

  • Duplication that would not have occurred for people with very small syncs where we don't this the per partition limit

@brianjlai brianjlai merged commit 23df789 into master Apr 10, 2025
27 checks passed
@brianjlai brianjlai deleted the brian/intercom_fix_substream_state_persistence branch April 10, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants