Skip to content

Change use_super_read_only default back to false#10448

Merged
mattlord merged 2 commits intovitessio:mainfrom
planetscale:use_sre_default_false
Jun 6, 2022
Merged

Change use_super_read_only default back to false#10448
mattlord merged 2 commits intovitessio:mainfrom
planetscale:use_sre_default_false

Conversation

@mattlord
Copy link
Member

@mattlord mattlord commented Jun 6, 2022

Description

In this PR we change the default for the vttablet --use_super_read_only flag back to false (it was changed to true in v13 via #9312).

We are doing this because when this flag is true you may not be able to restart a replica/rdonly vttablet process. This is because:

  1. The tablet has enabled super_read_only in its mysqld because it's a replica tablet.
  2. When a tablet starts up, it attempts to run some DDL statements as the DBA user such as CREATE DATABASE IF NOT EXISTS _vt and that will fail with an error because the mysqld has super_read_only enabled.
  3. So the tablet will not be able to come back up properly.

We really should be enabling super_read_only, both in the MySQL config file and in the tablet via this flag, as without that we will in some cases allow errant GTIDs to be generated which are then lying in wait to cause later issues. We will enable it at both layers as part of adding full super_read_only support to Vitess in #10363 (which is targeted for v15).

Related Issue(s)

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation is not required as this is already reflected:
content/en/docs/13.0/reference/programs/vttablet.md:| -use_super_read_only | boolean | Set super_read_only flag when performing planned failover (default true) |
content/en/docs/14.0/reference/programs/vttablet.md:| --use_super_read_only |  | Set super_read_only flag when performing planned failover. |

This is because when this flag is true you may not be able to restart a
replica/rdonly vttablet process. This is because:
  1. The tablet has enabled super_read_only in its mysqld because it's
     a replica tablet.
  2. When a tablet starts up, it attempts to run some DDL statements as
     the DBA user such as CREATE DATABASE IF NOT EXISTS _vt and that
     will fail with an error because the mysqld has super_read_only
     enabled.
  3. So the tablet will not be able to come back up properly.

We really should be enabling super_read_only, both in the config file
and in the tablet via this flag, as without that we will in some
cases allow errant GTIDs to be generated which are then lying in wait
to cause later issues. We will enable it at both layers as part
of adding full super_read_only support to Vitess in (which is
targeted for v15):
  vitessio#10363

Signed-off-by: Matt Lord <mattalord@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2022

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has the correct release notes label. release notes none should only be used for PRs that are so trivial that they need not be included.
  • If a new flag is being introduced, review whether it is really needed. The flag names should be clear and intuitive (as far as possible), and the flag's help should be descriptive.

Bug fixes

  • There should be at least one unit or end-to-end test.
  • The Pull Request description should either include a link to an issue that describes the bug OR an actual description of the bug and how to reproduce, along with a description of the fix.

Non-trivial changes

  • There should be some code comments as to why things are implemented the way they are.

New/Existing features

  • Should be documented, either by modifying the existing documentation or creating new documentation.
  • New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • vtctl command output order should be stable and awk-able.

@mattlord mattlord removed the request for review from shlomi-noach June 6, 2022 19:06
Signed-off-by: Matt Lord <mattalord@gmail.com>
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