-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix binlog end log pos over lost data #1367
Fix binlog end log pos over lost data #1367
Conversation
… over 4g lost data
…er-lost-data Calculate whether the binlog log_pos overflows beyond 4G using end_log_pos and event_size.
when will this PR be merged? |
@shaohk thanks a lot for this PR, this sounds like a difficult problem to debug! Can you think of any ways that this check can be tested in go unit tests? I wonder if a test could:
Luckily, |
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.
Looks good! Added one comment requesting unit tests 🙇
…aohk/gh-ost into fix-binlog-end-log-pos-over-lost-data
@timvaillancourt Thank you for reviewing this PR. I have added unit tests as requested. Could you please take a look again? Thank you for your hard work. |
@@ -74,3 +75,23 @@ func (this *BinlogCoordinates) SmallerThanOrEquals(other *BinlogCoordinates) boo | |||
} | |||
return this.LogFile == other.LogFile && this.LogPos == other.LogPos | |||
} | |||
|
|||
// IsLogPosOverflowBeyond4Bytes returns true if the coordinate endpos is overflow beyond 4 bytes. |
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.
@shaohk last request, can we add a reference to why a value over 4 bytes is an overflow?
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.
@timvaillancourt OK, I have added. Please take a look again, Thks.
change IsLogPosOverflowBeyond4Bytes comment.
@shaohk Can you take a look at the failing tests and linter? |
LGTM, can you take another look @timvaillancourt? |
@meiji163 / @shaohk: I think erroring here is the easiest next step, so LGTM 👍 But longer term, what do we "want" |
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.
Approved with longer-term question
I'm not sure how MySQL handles it |
So I believe that MySQL master-slave replication is based on the GTID mode, so there is no problem with MySQL master-slave replication. The gh-ost tool for synchronizing binlogs uses a non-GTID mode, which is why this issue arises. |
@shaohk great, thanks for clarifying! I made an attempt to add GTID support to |
Related issue: #1366
Description
This PR [Fix binlog end log pos over lost data]
script/cibuild
returns with no formatting errors, build errors or unit test errors.