Copilot commented on code in PR #311:
URL:
https://github.com/apache/kvrocks-controller/pull/311#discussion_r2084668058
##########
docs/API.md:
##########
@@ -486,6 +486,40 @@ DELETE
/api/v1/namespaces/{namespace}/clusters/{cluster}/shards/{shard}
}
```
+### Failover master node in a shard
+
Review Comment:
[nitpick] Consider adding a brief explanation or context on when to use the
failover endpoint and how to obtain the 'preferred_node_id' value, to ensure
consistency with the rest of the API documentation.
```suggestion
This endpoint is used to manually trigger a failover of the master node in a
specific shard.
Use this endpoint during maintenance operations or when the current master
node is unresponsive or degraded.
The `preferred_node_id` parameter specifies the ID of the node you want to
promote as the new master.
You can obtain the `preferred_node_id` by querying the cluster's state using
the appropriate API endpoint
or by consulting your cluster's configuration and monitoring tools.
```
##########
docs/API.md:
##########
@@ -486,6 +486,40 @@ DELETE
/api/v1/namespaces/{namespace}/clusters/{cluster}/shards/{shard}
}
```
+### Failover master node in a shard
+
+```
+POST /api/v1/namespaces/{namespace}/clusters/{cluster}/shards/{shard}/failover
+```
+
+#### Request Body
+
+```json
+{
+ "preferred_node_id": "{YOUR PREFERRED NODE ID}"
+}
+```
+
+#### Response JSON Body
+
+* 200
+```json
+{
+ "data": {
+ "new_master_id": "{NEW MASTER ID}"
+ }
+}
+```
+
+* 5XX
Review Comment:
[nitpick] It might be helpful to provide more context or examples on
potential error scenarios and what constitutes a valid error message, to
further guide API consumers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]