moco icon indicating copy to clipboard operation
moco copied to clipboard

Disable binlog during restore

Open shunki-fujita opened this issue 2 years ago • 1 comments

What

Enabling binlog output during restoration slows down the process. It is better to disable binlog during the restore and enable binlog after the restore is complete.

How

Disable binlog during restoration and re-enable binlog after the restoration completes.

Consider the following parameters for further optimization.

skip-innodb_doublewrite
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT_NO_FSYNC

Checklist

  • [ ] Finish implementation of the issue
  • [ ] Test all functions
  • [ ] Have enough logs to trace activities
  • [ ] Notify developers of necessary actions

shunki-fujita avatar Jul 13 '22 04:07 shunki-fujita

While reading restore.go, I noticed that the option -skipBinlog=true was included. Thus, binlog was disabled during the restore. https://github.com/cybozu-go/moco/blob/539a90d2e329589f4d05612080584a30820b32b3/pkg/bkop/restore.go#L36

shunki-fujita avatar Jul 15 '22 03:07 shunki-fujita