github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/cluster/gossip.proto (about)

     1  syntax = "proto3";
     2  package cluster;
     3  option go_package = "/github.com/asynkron/protoactor-go/cluster";
     4  import "google/protobuf/any.proto";
     5  
     6  
     7  message GossipRequest {
     8    string member_id = 2;
     9    GossipState state = 1;
    10  }
    11  
    12  //Ack a gossip request
    13  message GossipResponse {
    14    GossipState state = 1;
    15  }
    16  
    17  //two GossipState objects can be merged
    18  //key + member_id gets it's own entry, if collision, highest version is selected
    19  message GossipState {
    20    message GossipMemberState {
    21      map<string, GossipKeyValue> values = 1;
    22    }
    23  
    24    map<string, GossipMemberState>  members = 1;
    25  }
    26  
    27  
    28  
    29  //a known key might be heartbeat. if we locally tag each entry with a local timestamp
    30  //this means that we can measure if we have not received a new heartbeat from one member in some time
    31  //even if we don't know the exact time the heartbeat was issued, due to clock differences.
    32  //we still know when _we_ as in this node, got this data.
    33  //and we can measure time from then til now.
    34  //
    35  //if we got a hear-beat from another node, and X seconds pass, we can assume it to be dead
    36  message GossipKeyValue {
    37    int64 sequence_number = 2; //version is local to the owner member
    38    google.protobuf.Any value = 4; //value is any format
    39    int64  local_timestamp_unix_milliseconds = 5;
    40  }
    41  
    42  //represents a value that can be sent in form of a delta change
    43  //instead of a full value replace
    44  message GossipDeltaValue
    45  {
    46    //these are the entries of a delta value
    47    //this can be seen as an array with data, where each element in the array is tagged with a sequence number
    48    message GossipDeltaEntry
    49    {
    50      int64 sequence_number = 1;
    51      bytes data = 2;
    52    }
    53  
    54    repeated GossipDeltaEntry entries = 1;
    55  }