rpc.proto 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. syntax = "proto3";
  2. package rpcpb;
  3. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  4. option (gogoproto.marshaler_all) = true;
  5. option (gogoproto.sizer_all) = true;
  6. option (gogoproto.unmarshaler_all) = true;
  7. option (gogoproto.goproto_getters_all) = false;
  8. service Transport {
  9. rpc Transport(stream Request) returns (stream Response) {}
  10. }
  11. enum Operation {
  12. NotStarted = 0;
  13. // InitialStartEtcd is only called to start etcd very first time.
  14. InitialStartEtcd = 1;
  15. // RestartEtcd is sent to restart killed etcd.
  16. RestartEtcd = 2;
  17. // KillEtcd pauses etcd process while keeping data directories
  18. // and previous etcd configurations.
  19. KillEtcd = 3;
  20. // FailArchive is sent when consistency check failed,
  21. // thus need to archive etcd data directories.
  22. FailArchive = 4;
  23. // DestroyEtcdAgent destroys etcd process, etcd data, and agent server.
  24. DestroyEtcdAgent = 5;
  25. BlackholePeerPortTxRx = 100;
  26. UnblackholePeerPortTxRx = 101;
  27. DelayPeerPortTxRx = 102;
  28. UndelayPeerPortTxRx = 103;
  29. }
  30. message Etcd {
  31. string Name = 1 [(gogoproto.moretags) = "yaml:\"name\""];
  32. string DataDir = 2 [(gogoproto.moretags) = "yaml:\"data-dir\""];
  33. string WALDir = 3 [(gogoproto.moretags) = "yaml:\"wal-dir\""];
  34. repeated string ListenClientURLs = 4 [(gogoproto.moretags) = "yaml:\"listen-client-urls\""];
  35. repeated string AdvertiseClientURLs = 5 [(gogoproto.moretags) = "yaml:\"advertise-client-urls\""];
  36. repeated string ListenPeerURLs = 6 [(gogoproto.moretags) = "yaml:\"listen-peer-urls\""];
  37. repeated string InitialAdvertisePeerURLs = 7 [(gogoproto.moretags) = "yaml:\"initial-advertise-peer-urls\""];
  38. string InitialCluster = 8 [(gogoproto.moretags) = "yaml:\"initial-cluster\""];
  39. string InitialClusterState = 9 [(gogoproto.moretags) = "yaml:\"initial-cluster-state\""];
  40. string InitialClusterToken = 10 [(gogoproto.moretags) = "yaml:\"initial-cluster-token\""];
  41. int64 SnapshotCount = 11 [(gogoproto.moretags) = "yaml:\"snapshot-count\""];
  42. int64 QuotaBackendBytes = 12 [(gogoproto.moretags) = "yaml:\"quota-backend-bytes\""];
  43. bool PreVote = 13 [(gogoproto.moretags) = "yaml:\"pre-vote\""];
  44. bool InitialCorruptCheck = 14 [(gogoproto.moretags) = "yaml:\"initial-corrupt-check\""];
  45. // TODO: support TLS
  46. }
  47. message Member {
  48. // EtcdExecPath is the executable etcd binary path in agent server.
  49. string EtcdExecPath = 1 [(gogoproto.moretags) = "yaml:\"etcd-exec-path\""];
  50. // TODO: support embedded etcd
  51. // AgentAddr is the agent HTTP server address.
  52. string AgentAddr = 11 [(gogoproto.moretags) = "yaml:\"agent-addr\""];
  53. // FailpointHTTPAddr is the agent's failpoints HTTP server address.
  54. string FailpointHTTPAddr = 12 [(gogoproto.moretags) = "yaml:\"failpoint-http-addr\""];
  55. // BaseDir is the base directory where all logs and etcd data are stored.
  56. string BaseDir = 101 [(gogoproto.moretags) = "yaml:\"base-dir\""];
  57. // EtcdLogPath is the log file to store current etcd server logs.
  58. string EtcdLogPath = 102 [(gogoproto.moretags) = "yaml:\"etcd-log-path\""];
  59. // EtcdClientTLS is true when client traffic needs to be encrypted.
  60. bool EtcdClientTLS = 201 [(gogoproto.moretags) = "yaml:\"etcd-client-tls\""];
  61. // EtcdClientProxy is true when client traffic needs to be proxied.
  62. // If true, listen client URL port must be different than advertise client URL port.
  63. bool EtcdClientProxy = 202 [(gogoproto.moretags) = "yaml:\"etcd-client-proxy\""];
  64. // EtcdPeerProxy is true when peer traffic needs to be proxied.
  65. // If true, listen peer URL port must be different than advertise peer URL port.
  66. bool EtcdPeerProxy = 203 [(gogoproto.moretags) = "yaml:\"etcd-peer-proxy\""];
  67. // EtcdClientEndpoint is the etcd client endpoint.
  68. string EtcdClientEndpoint = 204 [(gogoproto.moretags) = "yaml:\"etcd-client-endpoint\""];
  69. // Etcd defines etcd binary configuration flags.
  70. Etcd Etcd = 301 [(gogoproto.moretags) = "yaml:\"etcd\""];
  71. }
  72. enum FailureCase {
  73. KILL_ONE_FOLLOWER = 0;
  74. KILL_LEADER = 1;
  75. KILL_ONE_FOLLOWER_FOR_LONG = 2;
  76. KILL_LEADER_FOR_LONG = 3;
  77. KILL_QUORUM = 4;
  78. KILL_ALL = 5;
  79. BLACKHOLE_PEER_PORT_TX_RX_ONE_FOLLOWER = 6;
  80. BLACKHOLE_PEER_PORT_TX_RX_LEADER = 7;
  81. BLACKHOLE_PEER_PORT_TX_RX_ALL = 8;
  82. DELAY_PEER_PORT_TX_RX_ONE_FOLLOWER = 9;
  83. DELAY_PEER_PORT_TX_RX_LEADER = 10;
  84. DELAY_PEER_PORT_TX_RX_ALL = 11;
  85. FAILPOINTS = 100;
  86. NO_FAIL = 200;
  87. // TODO: support no-op of liveness duration
  88. // NO_FAIL_LIVENESS = 201;
  89. EXTERNAL = 300;
  90. }
  91. enum StressType {
  92. KV = 0;
  93. LEASE = 1;
  94. NO_STRESS = 2;
  95. ELECTION_RUNNER = 3;
  96. WATCH_RUNNER = 4;
  97. LOCK_RACER_RUNNER = 5;
  98. LEASE_RUNNER = 6;
  99. }
  100. message Tester {
  101. string TesterNetwork = 1 [(gogoproto.moretags) = "yaml:\"tester-network\""];
  102. string TesterAddr = 2 [(gogoproto.moretags) = "yaml:\"tester-addr\""];
  103. // DelayLatencyMsRv is the delay latency in milliseconds,
  104. // to inject to simulated slow network.
  105. uint32 DelayLatencyMs = 11 [(gogoproto.moretags) = "yaml:\"delay-latency-ms\""];
  106. // DelayLatencyMsRv is the delay latency random variable in milliseconds.
  107. uint32 DelayLatencyMsRv = 12 [(gogoproto.moretags) = "yaml:\"delay-latency-ms-rv\""];
  108. // RoundLimit is the limit of rounds to run failure set (-1 to run without limits).
  109. int32 RoundLimit = 21 [(gogoproto.moretags) = "yaml:\"round-limit\""];
  110. // ExitOnFailure is true, then exit tester on first failure.
  111. bool ExitOnFailure = 22 [(gogoproto.moretags) = "yaml:\"exit-on-failure\""];
  112. // ConsistencyCheck is true to check consistency (revision, hash).
  113. bool ConsistencyCheck = 23 [(gogoproto.moretags) = "yaml:\"consistency-check\""];
  114. // EnablePprof is true to enable profiler.
  115. bool EnablePprof = 24 [(gogoproto.moretags) = "yaml:\"enable-pprof\""];
  116. // FailureCases is the selected test cases to schedule.
  117. // If empty, run all failure cases.
  118. // TODO: support no-op
  119. repeated string FailureCases = 31 [(gogoproto.moretags) = "yaml:\"failure-cases\""];
  120. // FailureShuffle is true to randomize failure injecting order.
  121. bool FailureShuffle = 32 [(gogoproto.moretags) = "yaml:\"failure-shuffle\""];
  122. // FailpointCommands is the list of "gofail" commands (e.g. panic("etcd-tester"),1*sleep(1000)).
  123. repeated string FailpointCommands = 33 [(gogoproto.moretags) = "yaml:\"failpoint-commands\""];
  124. // RunnerExecPath is a path of etcd-runner binary.
  125. string RunnerExecPath = 41 [(gogoproto.moretags) = "yaml:\"runner-exec-path\""];
  126. // ExternalExecPath is a path of script for enabling/disabling an external fault injector.
  127. string ExternalExecPath = 42 [(gogoproto.moretags) = "yaml:\"external-exec-path\""];
  128. // StressTypes is the list of stresser names:
  129. // keys, lease, nop, election-runner, watch-runner, lock-racer-runner, lease-runner.
  130. repeated string StressTypes = 101 [(gogoproto.moretags) = "yaml:\"stress-types\""];
  131. // StressKeySize is the size of each small key written into etcd.
  132. int32 StressKeySize = 102 [(gogoproto.moretags) = "yaml:\"stress-key-size\""];
  133. // StressKeySizeLarge is the size of each large key written into etcd.
  134. int32 StressKeySizeLarge = 103 [(gogoproto.moretags) = "yaml:\"stress-key-size-large\""];
  135. // StressKeySuffixRange is the count of key range written into etcd.
  136. // Stress keys are created with "fmt.Sprintf("foo%016x", rand.Intn(keySuffixRange)".
  137. int32 StressKeySuffixRange = 104 [(gogoproto.moretags) = "yaml:\"stress-key-suffix-range\""];
  138. // StressKeySuffixRangeTxn is the count of key range written into etcd txn (max 100).
  139. // Stress keys are created with "fmt.Sprintf("/k%03d", i)".
  140. int32 StressKeySuffixRangeTxn = 105 [(gogoproto.moretags) = "yaml:\"stress-key-suffix-range-txn\""];
  141. // StressKeyTxnOps is the number of operations per a transaction (max 64).
  142. int32 StressKeyTxnOps = 106 [(gogoproto.moretags) = "yaml:\"stress-key-txn-ops\""];
  143. // StressQPS is the maximum number of stresser requests per second.
  144. int32 StressQPS = 107 [(gogoproto.moretags) = "yaml:\"stress-qps\""];
  145. }
  146. message Request {
  147. Operation Operation = 1;
  148. Member Member = 2;
  149. Tester Tester = 3;
  150. }
  151. message Response {
  152. bool Success = 1;
  153. string Status = 2;
  154. // TODO: support TLS
  155. }