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

[Mysql]reduce number of BinlogSplitMetaEvent transmission between MySqlSoureReader and MySqlSourceEnumerator #1479

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

lidoudou1993
Copy link
Contributor

reduce number of BinlogSplitMetaEvent transmission between MySqlSoureReader and MySqlSourceEnumerator; fixed log MySqlSourceEnumerator

…eReader and MySqlSourceEnumerator; fixed log in MySqlSourceEnumerator
@@ -325,7 +325,7 @@ private void fillMetaDataForBinlogSplit(BinlogSplitMetaEvent metadataEvent) {
receivedMetaGroupId,
expectedMetaGroupId);
}
requestBinlogSplitMetaIfNeeded(binlogSplit);
requestBinlogSplitMetaIfNeeded(uncompletedBinlogSplits.get(binlogSplit.splitId()));
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this change, could you explain more ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

after fillMetaDataForBinlogSplit, will create a new binlogSplit in uncompletedBinlogSplits and cover last one , should use new binlogSplit to calculate nextMetaGroupId

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if use old binlogSplit,it will cause MySqlSourceReader send repeate BinlogSplitMetaRequestEvent and recevie repeate BinlogSplitMetaEvent

Copy link
Contributor

Choose a reason for hiding this comment

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

@lidoudou1993 Could you add a test for the PR?

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 recurrence this problem byMySqlSourceExampleTest in debug model. When set splitMetaGroupSize=5,splitSize=50 and two thousand record in table,it will lead receivedMetaGroupId != expectedMetaGroupId when use old binlogSplit calculate nextMetaGroupId,and MySqlSourceReader need send more BinlogSplitMetaRequestEvent to MySqlSourceEnumerator.
debug1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if use new binlogSplit to calculate nextMetaGroupId,this problem will not happen
debug2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@lidoudou1993 you're right, I catch your point

@leonardBang leonardBang merged commit 8b2094c into apache:master Oct 19, 2022
ChaomingZhangCN pushed a commit to ChaomingZhangCN/flink-cdc that referenced this pull request Jan 13, 2025
… next meta (apache#1479)

Co-authored-by: lidoudou3 <lidoudou1@jd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants