syntax = "proto3"; package rpcpb; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_getters_all) = false; service Transport { rpc Transport(stream Request) returns (stream Response) {} } enum Operation { NotStarted = 0; // InitialStartEtcd is only called to start etcd very first time. InitialStartEtcd = 1; // RestartEtcd is sent to restart killed etcd. RestartEtcd = 2; // KillEtcd pauses etcd process while keeping data directories // and previous etcd configurations. KillEtcd = 3; // FailArchive is sent when consistency check failed, // thus need to archive etcd data directories. FailArchive = 4; // DestroyEtcdAgent destroys etcd process, etcd data, and agent server. DestroyEtcdAgent = 5; BlackholePeerPortTxRx = 100; UnblackholePeerPortTxRx = 101; DelayPeerPortTxRx = 102; UndelayPeerPortTxRx = 103; } message Etcd { string Name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; string DataDir = 2 [(gogoproto.moretags) = "yaml:\"data-dir\""]; string WALDir = 3 [(gogoproto.moretags) = "yaml:\"wal-dir\""]; // HeartbeatIntervalMs is the time (in milliseconds) of a heartbeat interval. // Default value is 100, which is 100ms. int64 HeartbeatIntervalMs = 11 [(gogoproto.moretags) = "yaml:\"heartbeat-interval\""]; // ElectionTimeoutMs is the time (in milliseconds) for an election to timeout. // Default value is 1000, which is 1s. int64 ElectionTimeoutMs = 12 [(gogoproto.moretags) = "yaml:\"election-timeout\""]; repeated string ListenClientURLs = 21 [(gogoproto.moretags) = "yaml:\"listen-client-urls\""]; repeated string AdvertiseClientURLs = 22 [(gogoproto.moretags) = "yaml:\"advertise-client-urls\""]; repeated string ListenPeerURLs = 23 [(gogoproto.moretags) = "yaml:\"listen-peer-urls\""]; repeated string InitialAdvertisePeerURLs = 24 [(gogoproto.moretags) = "yaml:\"initial-advertise-peer-urls\""]; string InitialCluster = 31 [(gogoproto.moretags) = "yaml:\"initial-cluster\""]; string InitialClusterState = 32 [(gogoproto.moretags) = "yaml:\"initial-cluster-state\""]; string InitialClusterToken = 33 [(gogoproto.moretags) = "yaml:\"initial-cluster-token\""]; int64 SnapshotCount = 41 [(gogoproto.moretags) = "yaml:\"snapshot-count\""]; int64 QuotaBackendBytes = 42 [(gogoproto.moretags) = "yaml:\"quota-backend-bytes\""]; bool PreVote = 43 [(gogoproto.moretags) = "yaml:\"pre-vote\""]; bool InitialCorruptCheck = 44 [(gogoproto.moretags) = "yaml:\"initial-corrupt-check\""]; // TODO: support TLS } message Member { // EtcdExecPath is the executable etcd binary path in agent server. string EtcdExecPath = 1 [(gogoproto.moretags) = "yaml:\"etcd-exec-path\""]; // TODO: support embedded etcd // AgentAddr is the agent HTTP server address. string AgentAddr = 11 [(gogoproto.moretags) = "yaml:\"agent-addr\""]; // FailpointHTTPAddr is the agent's failpoints HTTP server address. string FailpointHTTPAddr = 12 [(gogoproto.moretags) = "yaml:\"failpoint-http-addr\""]; // BaseDir is the base directory where all logs and etcd data are stored. string BaseDir = 101 [(gogoproto.moretags) = "yaml:\"base-dir\""]; // EtcdLogPath is the log file to store current etcd server logs. string EtcdLogPath = 102 [(gogoproto.moretags) = "yaml:\"etcd-log-path\""]; // EtcdClientTLS is true when client traffic needs to be encrypted. bool EtcdClientTLS = 201 [(gogoproto.moretags) = "yaml:\"etcd-client-tls\""]; // EtcdClientProxy is true when client traffic needs to be proxied. // If true, listen client URL port must be different than advertise client URL port. bool EtcdClientProxy = 202 [(gogoproto.moretags) = "yaml:\"etcd-client-proxy\""]; // EtcdPeerProxy is true when peer traffic needs to be proxied. // If true, listen peer URL port must be different than advertise peer URL port. bool EtcdPeerProxy = 203 [(gogoproto.moretags) = "yaml:\"etcd-peer-proxy\""]; // EtcdClientEndpoint is the etcd client endpoint. string EtcdClientEndpoint = 204 [(gogoproto.moretags) = "yaml:\"etcd-client-endpoint\""]; // Etcd defines etcd binary configuration flags. Etcd Etcd = 301 [(gogoproto.moretags) = "yaml:\"etcd\""]; } enum FailureCase { KILL_ONE_FOLLOWER = 0; KILL_ONE_FOLLOWER_UNTIL_TRIGGER_SNAPSHOT = 1; KILL_LEADER = 2; KILL_LEADER_UNTIL_TRIGGER_SNAPSHOT = 3; KILL_QUORUM = 4; KILL_ALL = 5; BLACKHOLE_PEER_PORT_TX_RX_ONE_FOLLOWER = 100; BLACKHOLE_PEER_PORT_TX_RX_ONE_FOLLOWER_UNTIL_TRIGGER_SNAPSHOT = 101; BLACKHOLE_PEER_PORT_TX_RX_LEADER = 102; BLACKHOLE_PEER_PORT_TX_RX_LEADER_UNTIL_TRIGGER_SNAPSHOT = 103; BLACKHOLE_PEER_PORT_TX_RX_QUORUM = 104; BLACKHOLE_PEER_PORT_TX_RX_ALL = 105; DELAY_PEER_PORT_TX_RX_ONE_FOLLOWER = 200; DELAY_PEER_PORT_TX_RX_ONE_FOLLOWER_UNTIL_TRIGGER_SNAPSHOT = 201; DELAY_PEER_PORT_TX_RX_LEADER = 202; DELAY_PEER_PORT_TX_RX_LEADER_UNTIL_TRIGGER_SNAPSHOT = 203; DELAY_PEER_PORT_TX_RX_QUORUM = 204; DELAY_PEER_PORT_TX_RX_ALL = 205; // NO_FAIL_WITH_STRESS runs no-op failure injection for specified period // while stressers are still sending requests. NO_FAIL_WITH_STRESS = 300; // NO_FAIL_WITH_NO_STRESS_FOR_LIVENESS runs no-op failure injection // with all stressers stopped. NO_FAIL_WITH_NO_STRESS_FOR_LIVENESS = 301; FAILPOINTS = 400; EXTERNAL = 500; } enum StressType { KV = 0; LEASE = 1; ELECTION_RUNNER = 2; WATCH_RUNNER = 3; LOCK_RACER_RUNNER = 4; LEASE_RUNNER = 5; } message Tester { string TesterNetwork = 1 [(gogoproto.moretags) = "yaml:\"tester-network\""]; string TesterAddr = 2 [(gogoproto.moretags) = "yaml:\"tester-addr\""]; // DelayLatencyMsRv is the delay latency in milliseconds, // to inject to simulated slow network. uint32 DelayLatencyMs = 11 [(gogoproto.moretags) = "yaml:\"delay-latency-ms\""]; // DelayLatencyMsRv is the delay latency random variable in milliseconds. uint32 DelayLatencyMsRv = 12 [(gogoproto.moretags) = "yaml:\"delay-latency-ms-rv\""]; // RoundLimit is the limit of rounds to run failure set (-1 to run without limits). int32 RoundLimit = 21 [(gogoproto.moretags) = "yaml:\"round-limit\""]; // ExitOnFailure is true, then exit tester on first failure. bool ExitOnFailure = 22 [(gogoproto.moretags) = "yaml:\"exit-on-failure\""]; // ConsistencyCheck is true to check consistency (revision, hash). bool ConsistencyCheck = 23 [(gogoproto.moretags) = "yaml:\"consistency-check\""]; // EnablePprof is true to enable profiler. bool EnablePprof = 24 [(gogoproto.moretags) = "yaml:\"enable-pprof\""]; // FailureCases is the selected test cases to schedule. // If empty, run all failure cases. repeated string FailureCases = 31 [(gogoproto.moretags) = "yaml:\"failure-cases\""]; // FailureDelayMs is the delay duration after failure is injected. // Useful when triggering snapshot or no-op failure cases. uint32 FailureDelayMs = 32 [(gogoproto.moretags) = "yaml:\"failure-delay-ms\""]; // FailureShuffle is true to randomize failure injecting order. bool FailureShuffle = 33 [(gogoproto.moretags) = "yaml:\"failure-shuffle\""]; // FailpointCommands is the list of "gofail" commands (e.g. panic("etcd-tester"),1*sleep(1000)). repeated string FailpointCommands = 34 [(gogoproto.moretags) = "yaml:\"failpoint-commands\""]; // RunnerExecPath is a path of etcd-runner binary. string RunnerExecPath = 41 [(gogoproto.moretags) = "yaml:\"runner-exec-path\""]; // ExternalExecPath is a path of script for enabling/disabling an external fault injector. string ExternalExecPath = 42 [(gogoproto.moretags) = "yaml:\"external-exec-path\""]; // StressTypes is the list of stresser names: // keys, lease, nop, election-runner, watch-runner, lock-racer-runner, lease-runner. repeated string StressTypes = 101 [(gogoproto.moretags) = "yaml:\"stress-types\""]; // StressKeySize is the size of each small key written into etcd. int32 StressKeySize = 102 [(gogoproto.moretags) = "yaml:\"stress-key-size\""]; // StressKeySizeLarge is the size of each large key written into etcd. int32 StressKeySizeLarge = 103 [(gogoproto.moretags) = "yaml:\"stress-key-size-large\""]; // StressKeySuffixRange is the count of key range written into etcd. // Stress keys are created with "fmt.Sprintf("foo%016x", rand.Intn(keySuffixRange)". int32 StressKeySuffixRange = 104 [(gogoproto.moretags) = "yaml:\"stress-key-suffix-range\""]; // StressKeySuffixRangeTxn is the count of key range written into etcd txn (max 100). // Stress keys are created with "fmt.Sprintf("/k%03d", i)". int32 StressKeySuffixRangeTxn = 105 [(gogoproto.moretags) = "yaml:\"stress-key-suffix-range-txn\""]; // StressKeyTxnOps is the number of operations per a transaction (max 64). int32 StressKeyTxnOps = 106 [(gogoproto.moretags) = "yaml:\"stress-key-txn-ops\""]; // StressClients is the number of concurrent stressing clients // with "one" shared TCP connection. int32 StressClients = 201 [(gogoproto.moretags) = "yaml:\"stress-clients\""]; // StressQPS is the maximum number of stresser requests per second. int32 StressQPS = 202 [(gogoproto.moretags) = "yaml:\"stress-qps\""]; } message Request { Operation Operation = 1; Member Member = 2; Tester Tester = 3; } message Response { bool Success = 1; string Status = 2; // TODO: support TLS }