github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/closedts/ctpb/entry.proto (about)

     1  // Copyright 2018 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.ctupdate;
    13  option go_package = "ctpb";
    14  
    15  import "gogoproto/gogo.proto";
    16  import "google/api/annotations.proto";
    17  
    18  import "util/hlc/timestamp.proto";
    19  
    20  // An Entry is a closed timestamp update. It consists of a closed timestamp
    21  // (i.e. a timestamp at or below which the origin node guarantees no more new
    22  // writes are going to be permitted), an associated epoch in which the origin
    23  // node promises it was live (for the closed timestamp), a map of minimum lease
    24  // applied indexes (which have to be caught up to before being allowed to use
    25  // the closed timestamp) as well as an indicator of whether this update supplies
    26  // a full initial state or an increment to be merged into a previous state. In
    27  // practice, the first Entry received for each epoch is full, while the remainder
    28  // are incremental. An incremental update represents the implicit promise that
    29  // the state accumulated since the last full Entry is the true full state.
    30  message Entry {
    31    option (gogoproto.goproto_stringer) = false;
    32  
    33    int64 epoch = 1 [(gogoproto.casttype) = "Epoch"];
    34    util.hlc.Timestamp closed_timestamp = 2 [(gogoproto.nullable) = false];
    35    map<int32, int64> mlai = 3 [(gogoproto.castkey) = "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID",
    36      (gogoproto.castvalue) = "LAI",
    37      (gogoproto.customname) = "MLAI"];
    38    // Full is true if the emitter promises that any future write to any range
    39    // mentioned in this Entry will be reflected in a subsequent Entry before any
    40    // stale follower reads are possible. For example, if range 1 is assigned an
    41    // MLAI of 12 in this Entry and isn't mentioned in the five subsequent
    42    // entries, the recipient may behave as if the MLAI of 12 were repeated across
    43    // all of these entries.
    44    //
    45    // In practice, a Full message is received when a stream of Entries is first
    46    // established (or the Epoch changes), and all other updates are incremental
    47    // (i.e. not Full).
    48    bool full = 4;
    49  }
    50  
    51  // Reactions flow in the direction opposite to Entries and request for ranges to
    52  // be included in the next Entry. Under rare circumstances, ranges may be omitted
    53  // from closed timestamp updates, and so serving follower reads from them would
    54  // fail. The Reaction mechanism serves to explicitly request the missing information
    55  // when that happens.
    56  message Reaction {
    57    option (gogoproto.goproto_stringer) = false;
    58  
    59    repeated int32 Requested = 1 [(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID"];
    60  }
    61