You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the recommended way to save position to the database after each OnRow event?
The reason I'd like to save the position is so I can restart the program and have it start where it left off. I'm guessing this is a common use case and others are already doing this.
I've tried OnPosSynced but because I'm saving the position to the same database it causes it to fire endlessly.
My current implementation is to use e.Header.LogPos something like below. It appears to work but I'm worried there are cases I'm not considering.
I'm not a canel user (we directly use BinlogSyncer) but that's not much difference. Considering DML, I think it's XIDEvent rather than RowsEvent that can be used to (re)start a binlog replication. So OnRow does not provide the position to caller.
@cameron-p-m thanks, I don't have GTID_MODE=ON so I can't use GTIDSet. I believe it would have the same issue there where every time I save the GTIDSet back to the database it would fire the event.
@lance6716 it appears that e.Header.LogPos from the OnRow event works well for my needs.
What is the recommended way to save position to the database after each
OnRow
event?The reason I'd like to save the position is so I can restart the program and have it start where it left off. I'm guessing this is a common use case and others are already doing this.
I've tried
OnPosSynced
but because I'm saving the position to the same database it causes it to fire endlessly.My current implementation is to use
e.Header.LogPos
something like below. It appears to work but I'm worried there are cases I'm not considering.Any issues with the current implementation or better ways to go about this?
The text was updated successfully, but these errors were encountered: