etcdserverpb: document "Hash" and "HashKV" more clearly

Explain where the computation happens (e.g. "Hash" for all buckets
and "HashKV" for "key" bucket).

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-04-03 11:50:20 -07:00
parent 358a89c7e9
commit 11818b5f40
4 changed files with 24 additions and 12 deletions

View File

@ -69,8 +69,8 @@ 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. |
| Hash | HashRequest | HashResponse | Hash computes the hash of the KV's backend. This is designed for testing; do not use this in production when there are ongoing transactions. |
| HashKV | HashKVRequest | HashKVResponse | HashKV computes the hash of all MVCC keys up to a given revision. |
| 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. |

View File

@ -966,7 +966,7 @@
"tags": [
"Maintenance"
],
"summary": "HashKV computes the hash of all MVCC keys up to a given revision.",
"summary": "HashKV computes the hash of all MVCC keys up to a given revision.\nIt only iterates \"key\" bucket in backend storage.",
"operationId": "HashKV",
"parameters": [
{

View File

@ -3983,11 +3983,15 @@ type MaintenanceClient interface {
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
// Defragment defragments a member's backend database to recover storage space.
Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error)
// Hash computes the hash of the KV's backend.
// This is designed for testing; do not use this in production when there
// are ongoing transactions.
// 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.
Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error)
// HashKV computes the hash of all MVCC keys up to a given revision.
// It only iterates "key" bucket in backend storage.
HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error)
// Snapshot sends a snapshot of the entire backend from a member over a stream to a client.
Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error)
@ -4098,11 +4102,15 @@ type MaintenanceServer interface {
Status(context.Context, *StatusRequest) (*StatusResponse, error)
// Defragment defragments a member's backend database to recover storage space.
Defragment(context.Context, *DefragmentRequest) (*DefragmentResponse, error)
// Hash computes the hash of the KV's backend.
// This is designed for testing; do not use this in production when there
// are ongoing transactions.
// 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.
Hash(context.Context, *HashRequest) (*HashResponse, error)
// HashKV computes the hash of all MVCC keys up to a given revision.
// It only iterates "key" bucket in backend storage.
HashKV(context.Context, *HashKVRequest) (*HashKVResponse, error)
// Snapshot sends a snapshot of the entire backend from a member over a stream to a client.
Snapshot(*SnapshotRequest, Maintenance_SnapshotServer) error

View File

@ -192,9 +192,12 @@ service Maintenance {
};
}
// Hash computes the hash of the KV's backend.
// This is designed for testing; do not use this in production when there
// are ongoing transactions.
// 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.
rpc Hash(HashRequest) returns (HashResponse) {
option (google.api.http) = {
post: "/v3/maintenance/hash"
@ -203,6 +206,7 @@ service Maintenance {
}
// HashKV computes the hash of all MVCC keys up to a given revision.
// It only iterates "key" bucket in backend storage.
rpc HashKV(HashKVRequest) returns (HashKVResponse) {
option (google.api.http) = {
post: "/v3/maintenance/hash"