DEV Community

Michael
Michael

Posted on • Originally published at gbase.cn

GBase 8a Cluster Modes: NORMAL, READONLY, and RECOVERY Explained

GBase 8a MPP Cluster provides three operating modes that control what SQL operations are allowed: NORMAL, READONLY, and RECOVERY. Administrators switch between them manually to match the current operational need — from everyday production to maintenance windows and disaster recovery.

The Three Modes at a Glance

Mode Allowed SQL Forbidden SQL Purpose
NORMAL Everything: SELECT, DML, DDL, LOAD DATA Nothing Day‑to‑day production with full read/write capability.
READONLY SELECT queries only All writes: DML, DDL, LOAD DATA Safe maintenance window — freezes data while keeping queries running.
RECOVERY Nothing (not even SELECT) Everything Extreme data protection during restore or critical repair.

When to Use Each Mode

NORMAL: Default Production Mode

The cluster serves all reads and writes. Major maintenance that could affect consistency or availability should not be performed in this mode.

READONLY: Standard Maintenance & Change Window

This is the go‑to mode for planned operations — effectively a "maintenance mode". Use it for:

  • Scaling up/down: Prevents concurrent writes during data redistribution.
  • Node replacement: The cluster can automatically or manually enter read‑only mode when swapping a failed node.
  • Backups: Ensures a consistent data view for logical backups.
  • Major application releases: Briefly freeze data while deploying.

RECOVERY: High‑Risk Repair Mode

Reserved for specific recovery scenarios and used only by senior administrators:

  • Restoring a cluster or VC from backups.
  • Disaster recovery drills.
  • Fixing severe logical corruption by importing external repair data.

All connections and queries are rejected in this mode — business is completely interrupted.

Viewing and Switching Modes

Check the Current Mode

gcadmin showcluster vc vc1
Enter fullscreen mode Exit fullscreen mode

Look for the VIRTUAL CLUSTER MODE field in the output.

Switch Modes Manually

# Set the entire cluster to read‑only
gcadmin switchmode readonly

# Set a specific VC to recovery mode
gcadmin switchmode recovery vc vc1

# Return to normal mode
gcadmin switchmode normal
Enter fullscreen mode Exit fullscreen mode

Best Practices

Mode Frequency Business Impact Rule of Thumb
NORMAL Always on None Production runs with full features.
READONLY Often (maintenance) Queries unaffected; writes paused Switch to read‑only before any change.
RECOVERY Rarely Full outage Use recovery only at the foundation level.
  • Always switch to READONLY before planned maintenance such as node changes or backups.
  • RECOVERY mode is an "operating room" — notify stakeholders and have a rollback plan.
  • Mode switches are fast, but schedule them during off‑peak hours when possible.

Using these three modes wisely keeps your gbase database safe and your maintenance operations smooth. It's a simple but powerful part of the GBASE cluster management toolkit.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.