-
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
Opt out of binlogs #759
Opt out of binlogs #759
Conversation
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.
@shlomi-noach @evanelias this is still WIP, but mostly done. I'm curious about your thoughts on this.
@@ -90,6 +90,7 @@ func main() { | |||
cutOver := flag.String("cut-over", "atomic", "choose cut-over type (default|atomic, two-step)") | |||
flag.BoolVar(&migrationContext.ForceNamedCutOverCommand, "force-named-cut-over", false, "When true, the 'unpostpone|cut-over' interactive command must name the migrated table") | |||
flag.BoolVar(&migrationContext.ForceNamedPanicCommand, "force-named-panic", false, "When true, the 'panic' interactive command must name the migrated table") | |||
flag.BoolVar(&migrationContext.UseBinLog, "sql-log-bin", true, "When true, gh-ost will write to the binlog for all operations that perform --test-on-replica, --migration-on-replica, and --allow-on-master") |
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.
I think we should discuss whether we should allow --allow-on-master
to work considering the scope of the GTID surgery. Feels super dangerous.
@@ -134,6 +134,16 @@ test_single() { | |||
echo_dot | |||
sleep 1 | |||
# | |||
|
|||
local callback_return | |||
if [ -f $tests_path/$test_name/before.sh ] ; then |
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.
I added a new way for tests to have before.sh/after.sh to expand on our tests. Each of the new tests depend on this.
@zmoazeni thank you for working on this. I'm ambivalent and am more inclined to run a There is at least one crucial logic whose path goes through the binary logs: the waitForEventsUpToLock logic. I don't see this PR handling the When
On a |
"strings" | ||
) | ||
|
||
type GTIDSet struct { |
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.
Ooh TIL about gtid_subtract
https://github.com/github/orchestrator/blob/19c0209e6790912909ff6849600251c0e2a439ab/go/inst/instance_topology_dao.go#L1164 (per @shlomi-noach's link)
Perhaps I don't need this logic after all.
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.
Hrm. I may be missing something, but I couldn't figure out a clean way to use gtid_subtract
and still have the functionality we're looking for. So I left it in.
Ah right on. I can drop the
This all might be moot if I drop the Unless I'm missing something important here. Are you saying that by excluding binary log writing of the other statements perhaps interferes with the locking logic and assumptions? |
What I was saying:
The above is my preferred view/opinion. It could be possible to get rid of all binlog entries, but at the cost of changing the cut-over logic; something I'm not keen on. |
Ahh I see your point. I was doing that to help #149:
I read that as: they have enough space on the server to duplicate the table but when we also account for the extra space in the binary log, things go haywire for that person. This PR would allow all the changelog events to still write to the binary log (which I believe appropriately handles
I totally agree with you here. I'm not wanting to change over the cut-over logic. I'll spend some more time reading up on |
Thanks for the feedback gang. I've been taking some vacation time lately. Will jump back in soon-ish to make changes based on the feedback! I believe the next iteration will be a legit non-draft PR. |
We can't fully stop all binary writing. But we can opt out of the vast majority of statements. The main one we need is the final changelog event to know when we can cut over. Users can only use this switch for in a few scenarios: --test-on-replica, --migrate-on-replica, or --allow-on-master
e36a406
to
29f462c
Compare
Hrm. There may be a timing issue. The test that is failing right now https://github.com/github/gh-ost/pull/759/checks?check_run_id=204694461 passes locally, but I can't seem to re-run without pushing a new commit. (I don't see a button to kick off a rebuild) |
Closing unmerged. I have since moved my focus elsewhere. |
This PR allows users to opt out of writing to binary logs for --test-on-replica, --migrate-on-replica, and --allow-on-master
--sql-log-bin
(bool) #149This is still WIP. I have a few things that I want to clarify or clean up:
--allow-on-master
?gtid_next
for every statement? Answer: Noscript/cibuild
returns with no formatting errors, build errors or unit test errors.