{"record":{"id":"9b6f8e4446a390d5","repo":"vitessio/vitess","slug":"mysqld-8-0-21-required-to-disable-the-redo-log","errorCode":null,"errorMessage":"mysqld >= 8.0.21 required to disable the redo log","messagePattern":"mysqld >= 8\\.0\\.21 required to disable the redo log","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/redo_log.go","lineNumber":41,"sourceCode":"\nfunc (mysqld *Mysqld) DisableRedoLog(ctx context.Context) error {\n\treturn mysqld.ExecuteSuperQuery(ctx, \"ALTER INSTANCE DISABLE INNODB REDO_LOG\")\n}\n\nfunc (mysqld *Mysqld) EnableRedoLog(ctx context.Context) error {\n\treturn mysqld.ExecuteSuperQuery(ctx, \"ALTER INSTANCE ENABLE INNODB REDO_LOG\")\n}\n\nfunc (mysqld *Mysqld) ProcessCanDisableRedoLog(ctx context.Context) (bool, error) {\n\tqr, err := mysqld.FetchSuperQuery(ctx, \"SELECT variable_value FROM performance_schema.global_status WHERE variable_name = 'innodb_redo_log_enabled'\")\n\tif err != nil {\n\t\t// It's possible that the MySQL process can disable redo logging, but\n\t\t// we were unable to connect in order to verify. Let's assume not and\n\t\t// let the caller decide if they want to retry.\n\t\treturn false, err\n\t}\n\tif len(qr.Rows) == 0 {\n\t\treturn false, errors.New(\"mysqld >= 8.0.21 required to disable the redo log\")\n\t}\n\treturn true, nil\n}\n","sourceCodeStart":23,"sourceCodeEnd":45,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/redo_log.go#L23-L45","documentation":"ProcessCanDisableRedoLog queries MySQL to check whether the server supports disabling the InnoDB redo log (introduced in MySQL 8.0.21, via innodb_disable_redo_log). If the SELECT returns no rows, the MySQL version is too old to support the variable, so this error is thrown to signal the feature is unavailable. It is a capability gate, not an operational failure.","triggerScenarios":"Calling ProcessCanDisableRedoLog against a mysqld instance older than 8.0.21: the query for the redo-log capability variable succeeds but returns an empty result set (len(qr.Rows) == 0), causing errors.New(\"mysqld >= 8.0.21 required to disable the redo log\").","commonSituations":"Running backups or fast-restores with redo-log disabling (e.g. during restore to speed up data loading) against a MySQL 5.7 or MySQL 8.0.x (< 8.0.21) install; environments pinned to older MySQL builds such as Percona distributions lacking the feature.","solutions":["Upgrade mysqld to MySQL 8.0.21 or later so the redo-log disable capability variable exists.","If upgrading is not possible, skip the redo-log-disabling code path (don't attempt it on older servers).","Add a preflight version check (mysqlctl.ParseVersionString) before attempting to disable the redo log and log a clear skip message."],"exampleFix":"// before\n// assumes redo log can be disabled on any MySQL\ncanDisable, err := mysqld.ProcessCanDisableRedoLog(ctx)\n\n// after\n// gate on version first\nversion, _ := mysqld.GetVersionString()\nif mysqlctl.ParseVersionString(version).Major >= 8 && mysqlctl.ParseVersionString(version).Minor == 0 && mysqlctl.ParseVersionString(version).Patch >= 21 {\n    canDisable, err = mysqld.ProcessCanDisableRedoLog(ctx)\n} else {\n    log.Info(\"mysqld < 8.0.21, skipping redo log disable\")\n}","handlingStrategy":"validation","validationCode":"version, err := mysqld.GetVersionString(ctx)\nif err != nil { return err }\nv := mysqlctl.ParseVersionString(version)\ncanDisableRedoLog := v.Major > 8 || (v.Major == 8 && (v.Minor > 0 || v.Patch >= 21))\nif !canDisableRedoLog {\n    log.Info(\"mysqld < 8.0.21; redo log cannot be disabled\")\n}","typeGuard":null,"tryCatchPattern":"canDisable, err := mysqld.ProcessCanDisableRedoLog(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"8.0.21\") {\n        log.Info(\"redo log disable unsupported on this mysqld; continuing\")\n    } else {\n        return vterrors.Wrapf(err, \"checking redo log capability\")\n    }\n}","preventionTips":["Pin mysqld >= 8.0.21 wherever backup-time redo-log disabling is expected.","Run a version preflight in tablet/bootstrap code before enabling redo-log optimization paths.","Encode the minimum MySQL version in deployment checks rather than discovering it at runtime."],"tags":["mysql","version-compatibility","redo-log","backup"],"backgroundTag":"mysql-version-not-supported","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}