-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
init.proto
54 lines (46 loc) · 1.97 KB
/
init.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
syntax = "proto3";
package cockroach.server.serverpb;
option go_package = "serverpb";
import "gogoproto/gogo.proto";
import "roachpb/metadata.proto";
message BootstrapRequest { }
message BootstrapResponse { }
// JoinNodeRequest is used to specify to the server node what the client's
// MinimumSupportedVersion is. If it's not compatible with the rest of the
// cluster, the join attempt is refused.
message JoinNodeRequest {
roachpb.Version min_supported_version = 1;
// TODO(irfansharif): Use this field to provide the client's address so that
// the server is able to reach back to it, setting up bidirectional network
// links.
string addr = 2;
}
// JoinNodeResponse informs the joining node what the cluster id is, and what
// node id was allocated to it.
//
// TODO(irfansharif): We should use this RPC to tell us the right cluster
// version to use (instead of using the minimum possible version and relying on
// gossip to bump to for us).
// TODO(irfansharif): We should use this RPC to also generate store IDs, instead
// of having each node do it for itself after being handed out a node ID.
message JoinNodeResponse {
bytes cluster_id = 1 [(gogoproto.customname) = "ClusterID"];
int32 node_id = 2 [(gogoproto.customname) = "NodeID"];
}
service Init {
// Bootstrap an uninitialized cluster (inter-node links set up through the
// --join flags).
rpc Bootstrap(BootstrapRequest) returns (BootstrapResponse) { }
// Join a bootstrapped cluster. If the target node is itself not part of a
// bootstrapped cluster, an appropriate error is returned.
rpc Join(JoinNodeRequest) returns (JoinNodeResponse) { }
}