Skip to content
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

backport: vtbackup: disable redo log before starting replication (#11330) #531

Closed
wants to merge 1 commit into from

Conversation

tanjinx
Copy link

@tanjinx tanjinx commented Oct 10, 2024

  • vtbackup: disable redo log before starting replication

According to MySQL docs:

As of MySQL 8.0.21, you can disable redo logging using the ALTER
INSTANCE DISABLE INNODB REDO_LOG statement. This functionality is
intended for loading data into a new MySQL instance. Disabling redo
logging speeds up data loading by avoiding redo log writes and
doublewrite buffering.

See: https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html#innodb-disable-redo-logging

We can take advantage of this in vtbackup. This change disables the redo log on MySQL >= 8.0.21 before starting replication, and re-enables the redo log after stopping replication.

  • non-fatal error, robus status check, copyright current year

  • try checking redo log status in vtbackup e2e test

  • retain vtbackup temporary files so we can verify them in e2e test

  • make e2e test work with upgrade/downgrade tests

  • check for mysql 8.0.21 in e2e test redo log assertions

  • fmt.Println debug

  • perconnnaaaaaa

  • fix e2e flags

  • simplify e2e test, revert flags and cnf cruft

  • capitalize log msgs

  • dont verify redo log for --initial_backup

  • address pr comments: fix typo and remove package alias

  • address pr comments: report redo log enabled when we can't disable

  • rely on mysql server variable to determine if can disable/enable redo log

  • split up binary vs. process redo log capability

  • simplify further

  • Address my own pedantic nits

  • Sorry, can't help myself

Description

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Deployment Notes

* vtbackup: disable redo log before starting replication

According to MySQL docs:

> As of MySQL 8.0.21, you can disable redo logging using the ALTER
> INSTANCE DISABLE INNODB REDO_LOG statement. This functionality is
> intended for loading data into a new MySQL instance. Disabling redo
> logging speeds up data loading by avoiding redo log writes and
> doublewrite buffering.

See: https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html#innodb-disable-redo-logging

We can take advantage of this in vtbackup. This change disables the redo
log on MySQL >= 8.0.21 before starting replication, and re-enables the
redo log after stopping replication.

Signed-off-by: Max Englander <max@planetscale.com>

* non-fatal error, robus status check, copyright current year

Signed-off-by: Max Englander <max@planetscale.com>

* try checking redo log status in vtbackup e2e test

Signed-off-by: Max Englander <max@planetscale.com>

* retain vtbackup temporary files so we can verify them in e2e test

Signed-off-by: Max Englander <max@planetscale.com>

* make e2e test work with upgrade/downgrade tests

Signed-off-by: Max Englander <max@planetscale.com>

* check for mysql 8.0.21 in e2e test redo log assertions

Signed-off-by: Max Englander <max@planetscale.com>

* fmt.Println debug

Signed-off-by: Max Englander <max@planetscale.com>

* perconnnaaaaaa

Signed-off-by: Max Englander <max@planetscale.com>

* fix e2e flags

Signed-off-by: Max Englander <max@planetscale.com>

* simplify e2e test, revert flags and cnf cruft

Signed-off-by: Max Englander <max@planetscale.com>

* capitalize log msgs

Signed-off-by: Max Englander <max@planetscale.com>

* dont verify redo log for --initial_backup

Signed-off-by: Max Englander <max@planetscale.com>

* address pr comments: fix typo and remove package alias

Signed-off-by: Max Englander <max@planetscale.com>

* address pr comments: report redo log enabled when we can't disable

Signed-off-by: Max Englander <max@planetscale.com>

* rely on mysql server variable to determine if can disable/enable redo log

Signed-off-by: Max Englander <max@planetscale.com>

* split up binary vs. process redo log capability

Signed-off-by: Max Englander <max@planetscale.com>

* simplify further

Signed-off-by: Max Englander <max@planetscale.com>

* Address my own pedantic nits

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Sorry, can't help myself

Signed-off-by: Matt Lord <mattalord@gmail.com>

Signed-off-by: Max Englander <max@planetscale.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
@tanjinx tanjinx requested a review from a team as a code owner October 10, 2024 22:22
Copy link

Thanks for the contribution! Before we can merge this, we need @maxenglander to sign the Salesforce Inc. Contributor License Agreement.

@github-actions github-actions bot added this to the v15.0.5 milestone Oct 10, 2024
@tanjinx tanjinx closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants