Skip to content

Commit

Permalink
Change use_super_read_only default back to false
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mattlord committed Jun 6, 2022
1 parent 67944bb commit 6ed4419
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/flags/endtoend/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ max_rate_approach_threshold: 0.9
--unhealthy_threshold duration
replication lag after which a replica is considered unhealthy (default 2h0m0s)
--use_super_read_only
Set super_read_only flag when performing planned failover. (default true)
Set super_read_only flag when performing planned failover. (default false)
--v value
log level for V logs
--version
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttablet/tabletmanager/rpc_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (

var (
enableSemiSync = flag.Bool("enable_semi_sync", false, "Enable semi-sync when configuring replication, on primary and replica tablets only (rdonly tablets will not ack).")
setSuperReadOnly = flag.Bool("use_super_read_only", true, "Set super_read_only flag when performing planned failover.")
setSuperReadOnly = flag.Bool("use_super_read_only", false, "Set super_read_only flag when performing planned failover.")
)

// ReplicationStatus returns the replication status
Expand Down

0 comments on commit 6ed4419

Please sign in to comment.