Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show process list and kill #12635

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Documentation/dev-guide/api_concurrency_reference_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,16 @@ The election service exposes client-side election facilities as a gRPC interface



##### message `ProcessList` (api/mvccpb/kv.proto)

| Field | Description | Type |
| ----- | ----------- | ---- |
| id | | int64 |
| startTime=2 | | string |
| unixNano=3 | | int64 |
| sourceIP | | string |
| fullMethod | | string |
| requestStr | | string |



54 changes: 53 additions & 1 deletion Documentation/dev-guide/api_reference_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ This is a generated documentation. Please read the proto files for more.
| Alarm | AlarmRequest | AlarmResponse | Alarm activates, deactivates, and queries alarms regarding cluster health. |
| Status | StatusRequest | StatusResponse | Status gets the status of the member. |
| Defragment | DefragmentRequest | DefragmentResponse | Defragment defragments a member's backend database to recover storage space. |
| ShowProcessList | ShowProcessListRequest | ShowProcessListResponse | ShowProcessList gets the process list. |
| Kill | KillRequest | KillResponse | Kill kills a connection from show processlist. |
| Hash | HashRequest | HashResponse | Hash computes the hash of whole backend keyspace, including key, lease, and other buckets in storage. This is designed for testing ONLY! Do not rely on this in production with ongoing transactions, since Hash operation does not hold MVCC locks. Use "HashKV" API instead for "key" bucket consistency checks. |
| HashKV | HashKVRequest | HashKVResponse | HashKV computes the hash of all MVCC keys up to a given revision. It only iterates "key" bucket in backend storage. |
| Snapshot | SnapshotRequest | SnapshotResponse | Snapshot sends a snapshot of the entire backend from a member over a stream to a client. |
| MoveLeader | MoveLeaderRequest | MoveLeaderResponse | MoveLeader requests current leader node to transfer its leadership to transferee. |
| Downgrade | DowngradeRequest | DowngradeResponse | Downgrade requests downgrade, cancel downgrade on the cluster version. |
| Downgrade | DowngradeRequest | DowngradeResponse | Downgrade requests downgrades, verifies feasibility or cancels downgrade on the cluster version. Supported since etcd 3.5. |



Expand Down Expand Up @@ -516,6 +518,23 @@ Empty field.



##### message `KillRequest` (api/etcdserverpb/rpc.proto)

| Field | Description | Type |
| ----- | ----------- | ---- |
| type | | Type |
| id | | int64 |



##### message `KillResponse` (api/etcdserverpb/rpc.proto)

| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |



##### message `LeaseCheckpoint` (api/etcdserverpb/rpc.proto)

| Field | Description | Type |
Expand Down Expand Up @@ -843,6 +862,26 @@ Empty field.



##### message `ShowProcessListRequest` (api/etcdserverpb/rpc.proto)

| Field | Description | Type |
| ----- | ----------- | ---- |
| count_only | | bool |
| type | | Type |
| id | | int64 |



##### message `ShowProcessListResponse` (api/etcdserverpb/rpc.proto)

| Field | Description | Type |
| ----- | ----------- | ---- |
| header | | ResponseHeader |
| pls | | (slice of) mvccpb.ProcessList |
| count | | int64 |



##### message `SnapshotRequest` (api/etcdserverpb/rpc.proto)

Empty field.
Expand Down Expand Up @@ -984,6 +1023,19 @@ Empty field.



##### message `ProcessList` (api/mvccpb/kv.proto)

| Field | Description | Type |
| ----- | ----------- | ---- |
| id | | int64 |
| startTime=2 | | string |
| unixNano=3 | | int64 |
| sourceIP | | string |
| fullMethod | | string |
| requestStr | | string |



##### message `Lease` (server/lease/leasepb/lease.proto)

| Field | Description | Type |
Expand Down
163 changes: 162 additions & 1 deletion Documentation/dev-guide/apispec/swagger/rpc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@
"tags": [
"Maintenance"
],
"summary": "Downgrade requests downgrade, cancel downgrade on the cluster version.",
"summary": "Downgrade requests downgrades, verifies feasibility or cancels downgrade\non the cluster version.\nSupported since etcd 3.5.",
"operationId": "Maintenance_Downgrade",
"parameters": [
{
Expand Down Expand Up @@ -1308,6 +1308,72 @@
}
}
},
"/v3/maintenance/kill": {
"post": {
"tags": [
"Maintenance"
],
"summary": "Kill kills a connection from show processlist.",
"operationId": "Maintenance_Kill",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbKillRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbKillResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/v3/maintenance/showprocesslist": {
"post": {
"tags": [
"Maintenance"
],
"summary": "ShowProcessList gets the process list.",
"operationId": "Maintenance_ShowProcessList",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbShowProcessListRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbShowProcessListResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/v3/maintenance/snapshot": {
"post": {
"tags": [
Expand Down Expand Up @@ -2148,6 +2214,34 @@
}
}
},
"etcdserverpbKillRequest": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "int64"
},
"type": {
"$ref": "#/definitions/etcdserverpbKillRequestType"
}
}
},
"etcdserverpbKillRequestType": {
"type": "string",
"default": "OP",
"enum": [
"OP",
"STREAM"
]
},
"etcdserverpbKillResponse": {
"type": "object",
"properties": {
"header": {
"$ref": "#/definitions/etcdserverpbResponseHeader"
}
}
},
"etcdserverpbLeaseGrantRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2694,6 +2788,48 @@
}
}
},
"etcdserverpbShowProcessListRequest": {
"type": "object",
"properties": {
"count_only": {
"type": "boolean",
"format": "boolean"
},
"id": {
"type": "string",
"format": "int64"
},
"type": {
"$ref": "#/definitions/etcdserverpbShowProcessListRequestType"
}
}
},
"etcdserverpbShowProcessListRequestType": {
"type": "string",
"default": "OP",
"enum": [
"OP",
"STREAM"
]
},
"etcdserverpbShowProcessListResponse": {
"type": "object",
"properties": {
"count": {
"type": "string",
"format": "int64"
},
"header": {
"$ref": "#/definitions/etcdserverpbResponseHeader"
},
"pls": {
"type": "array",
"items": {
"$ref": "#/definitions/mvccpbProcessList"
}
}
}
},
"etcdserverpbSnapshotRequest": {
"type": "object"
},
Expand Down Expand Up @@ -2990,6 +3126,31 @@
}
}
},
"mvccpbProcessList": {
"type": "object",
"properties": {
"fullMethod": {
"type": "string"
},
"id": {
"type": "string",
"format": "int64"
},
"requestStr": {
"type": "string"
},
"sourceIP": {
"type": "string"
},
"startTime": {
"type": "string"
},
"unixNano": {
"type": "string",
"format": "int64"
}
}
},
"protobufAny": {
"type": "object",
"properties": {
Expand Down
Loading