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

destination-async-framework: use the value from stats counter for global state conversion #35111

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

subodh1810
Copy link
Contributor

@subodh1810 subodh1810 commented Feb 9, 2024

No issue for this. The GlobalAsyncStateManager assumes by default that the state message is by default PER-STREAM until an actual state message arrives. Meanwhile as records arrive, they are also being flushed and the record counter is decremented as records are flushed. Once a state message finally arrives and is identified as GLOBAL state, the previous counters need to be converted to GLOBAL type. We had a bug in conversion where we were using the decrementing counter instead of the stats counter.

@subodh1810 subodh1810 self-assigned this Feb 9, 2024
Copy link

vercel bot commented Feb 9, 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 Feb 12, 2024 8:30am

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Feb 9, 2024
Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

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

lgtm assuming I understood the behavior correctly

stateManager.decrement(stateId, 2);
List<PartialStateWithDestinationStats> stateAfterAllRecordsAreFlushed = stateManager.flushStates();
assertEquals(1, stateAfterAllRecordsAreFlushed.size());
assertEquals(6.0, stateAfterAllRecordsAreFlushed.get(0).stats().getRecordCount());
Copy link
Contributor

Choose a reason for hiding this comment

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

checking my understanding: without this PR, we would get 0 instead of 6 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, we would get 2

@subodh1810
Copy link
Contributor Author

subodh1810 commented Feb 12, 2024

/publish-java-cdk

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

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Feb 12, 2024
@subodh1810 subodh1810 merged commit a15bd21 into master Feb 12, 2024
24 checks passed
@subodh1810 subodh1810 deleted the async-state-manager-counter-fix-global-state branch February 12, 2024 08:48
xiaohansong pushed a commit that referenced this pull request Feb 13, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 21, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
xiaohansong pushed a commit that referenced this pull request Feb 27, 2024
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/destination/bigquery connectors/destination/snowflake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants