Skip to content

Commit

Permalink
Allows bootstrapping peer on addition (qdrant#529)
Browse files Browse the repository at this point in the history
* Allows bootstrapping peer on addition

* Review: warn on address replacement

* Review: more detailed comments
  • Loading branch information
e-ivkov authored May 2, 2022
1 parent 794384f commit 40c4c1e
Show file tree
Hide file tree
Showing 12 changed files with 613 additions and 81 deletions.
64 changes: 61 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ schemars = { version = "0.8.8", features = ["uuid"] }
itertools = "0.10"
anyhow = "1.0.57"
futures = "0.3.21"
clap = { version = "3.1.12", features = ["derive"] }

config = "~0.13.1"

Expand Down
33 changes: 29 additions & 4 deletions lib/api/src/grpc/proto/raft_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,37 @@ package qdrant;
import "google/protobuf/empty.proto";

service Raft {
/*
Send Raft message to another peer
*/
rpc Send (RaftMessage) returns (google.protobuf.Empty) {}
// Send Raft message to another peer
rpc Send (RaftMessage) returns (google.protobuf.Empty);
// Send to bootstrap peer
// Returns uri by id if bootstrap knows this peer
rpc WhoIs (PeerId) returns (Uri);
// Send to bootstrap peer
// Proposes to add this peer Uri and ID to a map of all peers
// Returns all peers
rpc AddPeerToKnown (Peer) returns (AllPeers);
// Send to bootstrap peer
// Proposes to add this peer as participant of consensus
rpc AddPeerAsParticipant (Peer) returns (google.protobuf.Empty);
}

message RaftMessage {
bytes message = 1;
}

message AllPeers {
repeated Peer all_peers = 1;
}

message Peer {
string uri = 1;
uint64 id = 2;
}

message PeerId {
uint64 id = 1;
}

message Uri {
string uri = 1;
}
Loading

0 comments on commit 40c4c1e

Please sign in to comment.