Implement Teardown (added back DB cache)#528
Implement Teardown (added back DB cache)#528shlomi-noach merged 3 commits intogithub:teardown-contribfrom
Conversation
| // this.binlogSyncer.Close() | ||
| // here. A new go-mysql version closes the binlog syncer connection independently. | ||
| // I will go against the sacred rules of comments and just leave this here. | ||
| // This is the year 2017. Let's see what year these comments get deleted. |
There was a problem hiding this comment.
@shlomi-noach I noticed from my testing that this was required to stop the binlog syncer from running indefinitely. i'm not sure if this comment is specific to running this code as a process that exits, but it seems this is necessary from my end. would appreciate any context you have on this, and if this change looks right to you
There was a problem hiding this comment.
I do get the following error in the log:
2017/12/18 11:51:15 binlogsyncer.go:126: [info] syncer is closing...
2017/12/18 11:51:15 binlogsyncer.go:554: [error] connection was bad
2017/12/18 11:51:15 binlogstreamer.go:47: [error] close sync with err: Sync was closed
2017/12/18 11:51:15 binlogsyncer.go:141: [info] syncer is closed
But it seems to not cause any issues.
If I don't have this explicit close, the binlogsyncer lingers on after the migration has finished:
2017-12-18 11:53:40 INFO Done migrating `zenpayroll_development`.`companies`
2017-12-18 11:53:40 INFO Removing socket file: /gh-ost/gh-ost.test.sock
2017-12-18 11:53:40 INFO Tearing down inspector
2017-12-18 11:53:40 INFO Tearing down applier
2017-12-18 11:53:40 INFO Tearing down streamer
2017/12/18 11:55:00 binlogsyncer.go:632: [info] rotate to (mysql-bin-changelog.001359, 4)
2017/12/18 11:55:00 binlogsyncer.go:632: [info] rotate to (mysql-bin-changelog.001359, 4)
2017/12/18 11:55:00 binlogsyncer.go:632: [info] rotate to (mysql-bin-changelog.001359, 4)
2017/12/18 12:00:00 binlogsyncer.go:632: [info] rotate to (mysql-bin-changelog.001360, 4)
2017/12/18 12:00:00 binlogsyncer.go:632: [info] rotate to (mysql-bin-changelog.001360, 4)
|
Thank you! To avoid repeated work I changed the base branch from |
shlomi-noach
left a comment
There was a problem hiding this comment.
I'll merge this and send for tests
| // here. A new go-mysql version closes the binlog syncer connection independently. | ||
| // I will go against the sacred rules of comments and just leave this here. | ||
| // This is the year 2017. Let's see what year these comments get deleted. | ||
| this.binlogSyncer.Close() |
There was a problem hiding this comment.
I will just need to test it in production and report back
This is a continuation of #479 and implements a migration specific DB cache that was causing memory issues observed in #526
There are two important differences added in separate commits:
Let me know your thoughts on this approach! Happy to revise what's needed.
Thanks again :)