gh-ost icon indicating copy to clipboard operation
gh-ost copied to clipboard

refactor cutover for MySQL 8.x rename feature && support OceanBase

Open whhe opened this issue 1 year ago • 2 comments

A Pull Request should be associated with an Issue.

Close #1433 Close #1427

Description

This PR is based on #715 by @shlomi-noach. There is a new option --oceanbase which is introduced for OceanBase Binlog Service, just like the azure and gcp options. This PR would also change the behavior of the atomic cut over on MySQL 8.0.13 and later versions, please let me know if anyone have concerns about it.

In case this PR introduced Go code changes:

  • [x] contributed code is using same conventions as original code
  • [x] script/cibuild returns with no formatting errors, build errors or unit test errors.

whhe avatar Jul 19 '24 09:07 whhe

Is this comment by Schlomi still relevant @whhe?

This complicates matters. I can't just place a lock on both tables, since I want to be able to keep writing to the ghost table what remains in the binary logs after having locked the original table. The only way to be able to do so is if the same connection which places the lock would be the one to apply the remaining events; this is doable but non trivial.

It looks like atomicCutOverMySQL8 still waits for the applier to finish the DML events up to the lock, while the table is locked with singletonDB

meiji163 avatar Nov 21 '24 17:11 meiji163

@meiji163 I added LockGhostTable after waitForEventsUpToLock, so it should lock the ghost table with singletonDB after all events are applied to the ghost table.

I removed the command-line flag oceanbase, it could be replaced by the new validateOceanBaseConnection function.

whhe avatar Nov 22 '24 05:11 whhe