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

feat: handle subevents in transaction payload event #827

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

hjweddie
Copy link
Contributor

@hjweddie hjweddie commented Oct 6, 2023

When using canal to handle MySQL 8.0 Compressed binlog, I find that it could not get any row.
Hope that we can support handle TransactionPayloadEvent in canal, not just in replication package

e := errors.Cause(err)
// if error is not ErrExcludedTable or ErrTableNotExist or ErrMissingTableMeta, stop canal
if e != ErrExcludedTable &&
e != schema.ErrTableNotExist &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

in the old code, the error may come from any return branch in handleRowsEvent, but in your change we only checked the last return. I made a quick check that the three errors of

		if e != ErrExcludedTable &&
			e != schema.ErrTableNotExist &&
			e != schema.ErrMissingTableMeta {

seems only come from c.GetTable

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 agree with you. In this case, I think the old code means to ignore three errors: ErrExcludedTable,schema.ErrTableNotExist, schema.ErrMissingTableMeta. So we can do this just after GetTable in handleRowsEvent

@lance6716 lance6716 merged commit f0f8617 into go-mysql-org:master Oct 11, 2023
13 checks passed
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