Change dual-region quorum

This page describes how to check the health status of your Spanner dual-region quorum, and how to manually change the quorum in case of service disruptions.

For more information about dual-regions, see Spanner Dual-region instance configurations.

Check dual-region quorum status

You can check the status of your dual-region quorum in the following ways.

  • On the Database overview page
  • Using the System insights dashboard

On the Database overview page

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that is in a dual-region configuration.

  3. Click the name of the database.

  4. Under Overview, look for the Quorum row, which shows the dual-region quorum status of your instance:

    • If quorum is met in both regions, the status shows Dual-region.

    • If a manual or Google-managed failover has been performed, you see the name of the serving region (for example, asia-south1).

System insights dashboard

After you create a dual-region configuration, you can view the Dual-region quorum availability metric on the Instance-level System insights dashboard.

For more information, see View the system insights dashboard.

Change the dual-region quorum from dual-region to single region (failover)

To failover manually if there is a regional outage or a network partitioning issue:

Google Cloud console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that is in a dual-region configuration.

  3. Click System insights in the navigation menu.

  4. Find the Dual-region quorum availability metric.

  5. If the Dual-region quorum availability metric shows there is disruption in a region, click Activate Cloud Shell button icon Activate Cloud Shell at the top of the Google Cloud console.

    The Cloud Shell opens.

  6. To change the dual-region quorum from dual-region to a single region, enter the following command found in the gcloud CLI tab: gcloud spanner databases change-quorum. For detailed instructions, refer to the gcloud tab.

gcloud CLI

Use the gcloud spanner databases change-quorum command to change the dual-region quorum from dual-region to a single region.

gcloud spanner databases change-quorum
    DATABASE_ID --instance=INSTANCE_ID
    --single-region --serving-location=SERVING_LOCATION
    [--etag=ETAG]

Replace the following:

  • DATABASE_ID: The permanent identifier of the database.

  • INSTANCE_ID: The permanent identifier for the instance.

  • SERVING_LOCATION: The regional instance configuration to which you want to failover. For example, if asia-south1 (Mumbai) is unhealthy, and you want to failover to asia-south2 (Delhi), input asia-south2. Make sure the SERVING_LOCATION is the healthy region. Choosing a wrong region to failover results in database unavailability, which is unrecoverable before the region is back online.

Optional flags:

  • --etag=ETAG: The ETAG argument can be used for replay protection.

To check the status of your quorum change operation, run the gcloud spanner databases describe command. The quorumInfo field provides information about the operation.

gcloud spanner databases describe DATABASE_ID
    --instance=INSTANCE_ID

Change the dual-region quorum from single region to dual-region (failback)

To failback manually after the disrupted region is healthy or after the network partition issue is resolved:

Google Cloud console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that is in a dual-region configuration.

  3. Click System insights in the navigation menu.

  4. Find the Dual-region quorum availability metric.

  5. On the Dual-region quorum availability metric, click Change region quorum.

    The Cloud Shell opens.

  6. To change the dual-region quorum from dual-region to a single region, enter the following command found in the gcloud CLI tab: gcloud spanner databases change-quorum. For detailed instructions, refer to the gcloud tab.

gcloud CLI

Use the gcloud spanner databases change-quorum command to change the dual-region quorum from single region to dual-region.

gcloud spanner databases change-quorum
    DATABASE_ID --instance=INSTANCE_ID
    --dual-region
    [--etag=ETAG]

Replace the following:

  • DATABASE_ID: The permanent identifier of the database.

  • INSTANCE_ID: The permanent identifier for the instance.

Optional flags:

  • --etag=ETAG: The ETAG argument can be used for optimistic concurrency control.

To check the status of your quorum change operation, run the gcloud spanner databases describe command. The quorumInfo field provides information about the operation.

gcloud spanner databases describe DATABASE_ID
    --instance=INSTANCE_ID

What's next