github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/roachpb/internal_raft.proto (about)

     1  // Copyright 2014 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 = "proto2";
    12  package cockroach.roachpb;
    13  option go_package = "roachpb";
    14  
    15  import "util/hlc/timestamp.proto";
    16  import "gogoproto/gogo.proto";
    17  
    18  // RaftTruncatedState contains metadata about the truncated portion of the raft log.
    19  // Raft requires access to the term of the last truncated log entry even after the
    20  // rest of the entry has been discarded.
    21  message RaftTruncatedState {
    22    option (gogoproto.equal) = true;
    23    option (gogoproto.populate) = true;
    24  
    25    // The highest index that has been removed from the log.
    26    optional uint64 index = 1 [(gogoproto.nullable) = false];
    27    // The term corresponding to 'index'.
    28    optional uint64 term = 2 [(gogoproto.nullable) = false];
    29  }
    30  
    31  // RangeTombstone contains information about a replica that has been deleted.
    32  message RangeTombstone {
    33    optional int32 next_replica_id = 1 [(gogoproto.nullable) = false,
    34        (gogoproto.customname) = "NextReplicaID", (gogoproto.casttype) = "ReplicaID"];
    35  }
    36  
    37  // RaftSnapshotData is the payload of a raftpb.Snapshot. It contains a raw copy of
    38  // all of the range's data and metadata, including the raft log, abort span, etc.
    39  message RaftSnapshotData {
    40    message KeyValue {
    41      optional bytes key = 1;
    42      optional bytes value = 2;
    43      optional util.hlc.Timestamp timestamp = 3 [(gogoproto.nullable) = false];
    44    }
    45    repeated KeyValue KV = 2 [(gogoproto.nullable) = false,
    46        (gogoproto.customname) = "KV"];
    47    // These are really raftpb.Entry, but we model them as raw bytes to avoid
    48    // roundtripping through memory.
    49    repeated bytes log_entries = 3;
    50    reserved 1;
    51  }