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, |
timvaillancourt
left a comment
There was a problem hiding this comment.
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. |
| 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.
@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.
@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" |
timvaillancourt
left a comment
There was a problem hiding this comment.
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/cibuildreturns with no formatting errors, build errors or unit test errors.