Perform a switchover pre-check

2024-11-06 03:13:28  Updated

Description

You can call this operation to check the current state of the primary and standby OceanBase clusters and determine whether a switchover operation can be performed.

Call description

Prerequisites

None.

Request path

POST /api/v2/ob/clusters/{id:[\\d]+}/switchoverPreCheck

Request parameters

None.

Response

Parameter Type Description
data Object The result of the switchover pre-check.
successful Boolean Indicates whether the request was successful.
timestamp Datetime The timestamp when the server completed the request.
duration Integer The time taken by the server to process the request (in milliseconds).
status Integer The HTTP status code.
traceId String The Trace ID of the request, used for troubleshooting.
server String The address of the application server that responded to the request.

Switchover pre-check result

Parameter Type Description
clusterId Long The ID of the OceanBase cluster.
clusterName String The name of the OceanBase cluster.
result Object The details of the pre-check result.

Pre-check result details

Parameter Type Description
valid Boolean Indicates whether the pre-check passed.
messages List The list of error messages.

Example

Sample response

{
  "data": {
    "result": {
      "messages": [
        "Switchover status of the specified cluster ob3231: NOT ALLOWED, unable to perform switchover, reason: PRIMARY CLUSTER DOING BACKUP",
        "Daily switchover pre-check failed, there are ongoing backup tasks, backup type: LOG_BACKUP"
      ],
      "valid": false
    }
  },
  "duration": 168,
  "server": "xxx.xxx.xxx.xxx",
  "status": 200,
  "successful": true,
  "timestamp": "2022-09-05T13:33:06.328+08:00",
  "traceId": "613a37ece824402b"
}

Contact Us