- Notifications
You must be signed in to change notification settings - Fork 1k
Allow to synchronise GTIDs 'OnPosSynced' #378
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
Conversation
btw, need to run gofmt. @siddontang @bejelith After running this in production for over a year, I think the concept of "forced" saving in OnXXXSynced is often not useful. Because we often have different requirements when to persist position metadata. We use SyncedPosition and SyncedGTIDSet to get the gtid or binlog pos that is "processed", and save it with custom position metadata saver periodically. |
@taylorchu on #379 i agree with you, but it all depends if u process the statements/rows synchronously or in batches... my idea is to execute the updates in the backend in a transactional way (and synchronise my own way) so that i dont endup in half applied transactions at the destination. The problem i have now is that in the OnSync event (end of a binlog transaction) it's impossible to retrieve the GTIDSet. |
Thanks @bejelith
I prefer this way even to break the compatibility. But we can provide another better name. @taylorchu |
PTAL @GregoryIan |
Also a problem of the single hook with both mysql.Position and mysql.GTIDSet is what the latter can be i think |
@siddontang I changed OnPosSynced, we should be good to go now.. unless u have another name to suggest |
canal/canal_test.go Outdated
} | ||
| ||
type canalTestSuite struct { | ||
h *testEventHandler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need it in somewhere except for L67?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didnt fully cleanup the previously implemented test case, doing it now
canal/canal_test.go Outdated
| ||
c *C | ||
c *C | ||
OnPosSyncedCalls []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anywhere to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didnt fully cleanup the previously implemented test case, doing it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems GTID has race condition in canal package, but I can't reproduce in my local environment
Looks like it's sporadic |
@siddontang this change is compatible with #379, i think is better to merge #379 first and eventually i can work on the eventual conflicts. |
LGTM now, Thanks @bejelith |
@siddontang PTAL |
We want to keep track of the GTID when a transaction has ended or a table has been updated