github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/api.proto (about) 1 // Copyright 2016 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 syntax = "proto3"; 12 package cockroach.kv.kvserver; 13 option go_package = "kvserver"; 14 15 import "roachpb/internal_raft.proto"; 16 import "storage/enginepb/mvcc.proto"; 17 import "storage/enginepb/mvcc3.proto"; 18 import "gogoproto/gogo.proto"; 19 20 // StoreRequestHeader locates a Store on a Node. 21 message StoreRequestHeader { 22 int32 node_id = 1 [(gogoproto.customname) = "NodeID", 23 (gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.NodeID"]; 24 int32 store_id = 2 [(gogoproto.customname) = "StoreID", 25 (gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.StoreID"]; 26 } 27 28 // A CollectChecksumRequest asks the addressed replica for the result of a 29 // roachpb.ComputeChecksumRequest. 30 message CollectChecksumRequest { 31 StoreRequestHeader header = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; 32 int64 range_id = 2 [(gogoproto.customname) = "RangeID", 33 (gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID"]; 34 // checksum_id identifies the corresponding roachpb.ComputeChecksumRequest. 35 bytes checksum_id = 3 [(gogoproto.nullable) = false, 36 (gogoproto.customname) = "ChecksumID", 37 (gogoproto.customtype) = "github.com/cockroachdb/cockroach/pkg/util/uuid.UUID"]; 38 bytes checksum = 4; 39 } 40 41 message CollectChecksumResponse { 42 // The checksum is the sha512 hash of the requested computation. It is empty 43 // if the computation failed. 44 bytes checksum = 1; 45 // snapshot is set if the roachpb.ComputeChecksumRequest had snapshot = true 46 // and the response checksum is different from the request checksum. 47 // 48 // TODO(tschottdorf): with larger ranges, this is no longer tenable. 49 // See https://github.com/cockroachdb/cockroach/issues/21128. 50 roachpb.RaftSnapshotData snapshot = 2; 51 // delta carries the stats of the range minus the recomputed stats. 52 storage.enginepb.MVCCStatsDelta delta = 3 [(gogoproto.nullable) = false]; 53 // persisted carries the persisted stats of the replica. 54 storage.enginepb.MVCCStats persisted = 4 [(gogoproto.nullable) = false]; 55 } 56 57 // WaitForApplicationRequest blocks until the addressed replica has applied the 58 // command with the specified lease index. 59 message WaitForApplicationRequest { 60 StoreRequestHeader header = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; 61 int64 range_id = 2 [(gogoproto.customname) = "RangeID", 62 (gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID"]; 63 uint64 lease_index = 3; 64 } 65 66 message WaitForApplicationResponse { 67 } 68 69 message WaitForReplicaInitRequest { 70 StoreRequestHeader header = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; 71 int64 range_id = 2 [(gogoproto.customname) = "RangeID", 72 (gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID"]; 73 } 74 75 message WaitForReplicaInitResponse { 76 } 77