vitessio/vitess · error

recovery.IsRecoveryDisabled(): %v

Error message

recovery.IsRecoveryDisabled(): %v

What it means

IsRecoveryDisabled wraps any error from its internal count query (checking the disable-recovery flag in the vtorc database) into this prefixed message. It indicates the check itself failed, not that recovery is disabled — the disabled result is unreliable in this case.

Source

Thrown at go/vt/vtorc/logic/disable_recovery.go:58

// IsRecoveryDisabled returns true if Recoveries are disabled globally
func IsRecoveryDisabled() (disabled bool, err error) {
	query := `SELECT
		COUNT(*) AS mycount
	FROM
		global_recovery_disable
	WHERE
		disable_recovery = ?
	`
	err = db.QueryVTOrc(query, sqlutils.Args(1), func(m sqlutils.RowMap) error {
		mycount := m.GetInt("mycount")
		disabled = (mycount > 0)
		return nil
	})
	if err != nil {
		errMsg := fmt.Sprintf("recovery.IsRecoveryDisabled(): %v", err)
		log.Error(errMsg)
		err = errors.New(errMsg)
	}
	return disabled, err
}

// DisableRecovery ensures recoveries are disabled globally
func DisableRecovery() error {
	_, err := db.ExecVTOrc(`INSERT OR IGNORE
		INTO global_recovery_disable (
			disable_recovery
		) VALUES (1)`)
	return err
}

// EnableRecovery ensures recoveries are enabled globally
func EnableRecovery() error {
	// The "WHERE" clause is just to avoid full-scan reports by monitoring tools
	_, err := db.ExecVTOrc(`DELETE
		FROM global_recovery_disable

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Check vtorc's backend database connectivity and credentials in the vtorc config.
  2. Verify the vtorc internal schema tables exist (run any vtorc schema-init/migration step).
  3. Inspect the wrapped error (%v payload) for the root MySQL error and address it.
  4. Retry after transient DB failures; executeCheckAndRecoverFunction will re-run checks on the next tick.
Defensive patterns

Strategy: retry

Validate before calling

if err := backendDBPing(); err != nil {
    return fmt.Errorf("backend DB unavailable before recovery-disable check: %w", err)
}

Try / catch

disabled, err := logic.IsRecoveryDisabled(ctx)
if err != nil {
    log.Error("could not determine recovery-disabled state; skipping this tick", slog.Any("error", err))
    return nil // retry on next check tick
}

Prevention

When it happens

Trigger: The SELECT counting disable-recovery entries fails: vtorc's backend database is unreachable, the config table is missing/corrupted, or a DB timeout occurred.

Common situations: vtorc backend MySQL restarted or network blip during the check; schema mismatch after upgrade (missing vtorc internal tables); wrong backend DB credentials.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/d400a6f5bfb69e82. Report an issue: GitHub.