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

Task: Add full super_read_only support in Vitess #10363

Closed
mattlord opened this issue May 24, 2022 · 0 comments · Fixed by #12206
Closed

Task: Add full super_read_only support in Vitess #10363

mattlord opened this issue May 24, 2022 · 0 comments · Fixed by #12206
Assignees
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)

Comments

@mattlord
Copy link
Contributor

mattlord commented May 24, 2022

The schema.engine, schemamanager, restore, … components perform DDL and assume they can do it anywhere, anytime — which they could before when using the root and/or vt_dba user which has the SUPER privilege and is thus not impacted by read_only. We really should be leveraging super_read_only as w/o it there will be times when we allow errant GTIDs that are then lying in wait to cause later failures, but as you can see in #10094 this will require some work.

We'll need to think this through and IMO do some refactoring so that we put a vttablet+mysqld into a specific mode where super_read_only is intentionally disabled for it — locking the tablet in the topo — to perform some specific task(s) (e.g. tablet init) and then re-enabling super_read_only upon completion of the task(s), rather than attempting to turn that global variable ON and OFF per query or session.

Note: super_read_only is a global variable so when disabling it so that we can execute specific queries in our session, we begin fighting/racing with tablet repair and other sessions

Note: the init_db.sql file contents would not support MariaDB – the actual file is used in various places too (from shell scripts, yaml files, etc), not just the embedded content (this is fine as MariaDB support is deprecated in v14.0)

Related Issues

mattlord added a commit to planetscale/vitess that referenced this issue May 24, 2022
This ended up causing various failures when that change was applied
in mysqlctl by updating its rice box (make embed_config). You can see
this in: vitessio#10094

We're instead going to schedule work to add full super_read_only
support to Vitess in: vitessio#10363

Signed-off-by: Matt Lord <[email protected]>
mattlord added a commit that referenced this issue May 25, 2022
* Revert super_read_only config file changes

This ended up causing various failures when that change was applied
in mysqlctl by updating its rice box (make embed_config). You can see
this in: #10094

We're instead going to schedule work to add full super_read_only
support to Vitess in: #10363

* Remove MySQL 5.6 config

This is a follow-up to #10295
mattlord added a commit to planetscale/vitess that referenced this issue Jun 6, 2022
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 <[email protected]>
mattlord added a commit that referenced this issue Jun 6, 2022
* Change use_super_read_only default back to false

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):
  #10363

Signed-off-by: Matt Lord <[email protected]>
@ajm188 ajm188 added the Type: Enhancement Logical improvement (somewhere between a bug and feature) label Jun 21, 2022
@deepthi deepthi added this to v16.0.0 Dec 1, 2022
@deepthi deepthi moved this to Backlog in v16.0.0 Dec 1, 2022
@frouioui frouioui removed this from v16.0.0 Feb 8, 2023
@frouioui frouioui added this to v17.0.0 Feb 8, 2023
@frouioui frouioui moved this to Backlog in v17.0.0 Feb 8, 2023
@frouioui frouioui moved this from Backlog to In Progress in v17.0.0 Feb 14, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in v17.0.0 Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants