md_doc_xds-test-descriptions.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>GRPC C++: xDS (Load-Balancing) Interop Test Case Descriptions</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">GRPC C++
  25. &#160;<span id="projectnumber">1.32.0</span>
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.17 -->
  34. <script type="text/javascript">
  35. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. /* @license-end */
  38. </script>
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  43. $(function() {
  44. initMenu('',true,false,'search.php','Search');
  45. $(document).ready(function() { init_search(); });
  46. });
  47. /* @license-end */</script>
  48. <div id="main-nav"></div>
  49. <!-- window showing the filter options -->
  50. <div id="MSearchSelectWindow"
  51. onmouseover="return searchBox.OnSearchSelectShow()"
  52. onmouseout="return searchBox.OnSearchSelectHide()"
  53. onkeydown="return searchBox.OnSearchSelectKey(event)">
  54. </div>
  55. <!-- iframe showing the search results (closed by default) -->
  56. <div id="MSearchResultsWindow">
  57. <iframe src="javascript:void(0)" frameborder="0"
  58. name="MSearchResults" id="MSearchResults">
  59. </iframe>
  60. </div>
  61. </div><!-- top -->
  62. <div class="PageDoc"><div class="header">
  63. <div class="headertitle">
  64. <div class="title">xDS (Load-Balancing) Interop Test Case Descriptions </div> </div>
  65. </div><!--header-->
  66. <div class="contents">
  67. <div class="textblock"><p>Client and server use <a href="../src/proto/grpc/testing/test.proto">test.proto</a>.</p>
  68. <h1><a class="anchor" id="autotoc_md240"></a>
  69. Server</h1>
  70. <p>The code for the xDS test server can be found at: <a href="https://github.com/grpc/grpc-java/blob/master/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java">Java</a> (other language implementations are in progress).</p>
  71. <p>Server should accept these arguments:</p>
  72. <ul>
  73. <li>&ndash;port=PORT<ul>
  74. <li>The port the server will run on.</li>
  75. </ul>
  76. </li>
  77. </ul>
  78. <h1><a class="anchor" id="autotoc_md241"></a>
  79. Client</h1>
  80. <p>The base behavior of the xDS test client is to send a constant QPS of unary messages and record the remote-peer distribution of the responses. Further, the client must expose an implementation of the <code>LoadBalancerStatsService</code> gRPC service to allow the test driver to validate the load balancing behavior for a particular test case (see below for more details).</p>
  81. <p>The code for the xDS test client can be at: <a href="https://github.com/grpc/grpc-java/blob/master/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestClient.java">Java</a> (other language implementations are in progress).</p>
  82. <p>Clients should accept these arguments:</p>
  83. <ul>
  84. <li>&ndash;fail_on_failed_rpcs=BOOL<ul>
  85. <li>If true, the client should exit with a non-zero return code if any RPCs fail after at least one RPC has succeeded, indicating a valid xDS config was received. This accounts for any startup-related delays in receiving an initial config from the load balancer. Default is false.</li>
  86. </ul>
  87. </li>
  88. <li>&ndash;num_channels=CHANNELS<ul>
  89. <li>The number of channels to create to the server.</li>
  90. </ul>
  91. </li>
  92. <li>&ndash;qps=QPS<ul>
  93. <li>The QPS per channel.</li>
  94. </ul>
  95. </li>
  96. <li>&ndash;server=HOSTNAME:PORT<ul>
  97. <li>The server host to connect to. For example, "localhost:8080"</li>
  98. </ul>
  99. </li>
  100. <li>&ndash;stats_port=PORT<ul>
  101. <li>The port for to expose the client's <code>LoadBalancerStatsService</code> implementation.</li>
  102. </ul>
  103. </li>
  104. </ul>
  105. <h1><a class="anchor" id="autotoc_md242"></a>
  106. Test Driver</h1>
  107. <p>Note that, unlike our other interop tests, neither the client nor the server has any notion of which of the following test scenarios is under test. Instead, a separate test driver is responsible for configuring the load balancer and the server backends, running the client, and then querying the client's <code>LoadBalancerStatsService</code> to validate load balancer behavior for each of the tests described below.</p>
  108. <h1><a class="anchor" id="autotoc_md243"></a>
  109. LoadBalancerStatsService</h1>
  110. <p>The service is defined as:</p>
  111. <div class="fragment"><div class="line">message LoadBalancerStatsRequest {</div>
  112. <div class="line"> // Request stats for the next num_rpcs sent by client.</div>
  113. <div class="line"> int32 num_rpcs = 1;</div>
  114. <div class="line"> // If num_rpcs have not completed within timeout_sec, return partial results.</div>
  115. <div class="line"> int32 timeout_sec = 2;</div>
  116. <div class="line">}</div>
  117. <div class="line"> </div>
  118. <div class="line">message LoadBalancerStatsResponse {</div>
  119. <div class="line"> // The number of completed RPCs for each peer.</div>
  120. <div class="line"> map&lt;string, int32&gt; rpcs_by_peer = 1;</div>
  121. <div class="line"> // The number of RPCs that failed to record a remote peer.</div>
  122. <div class="line"> int32 num_failures = 2;</div>
  123. <div class="line">}</div>
  124. <div class="line"> </div>
  125. <div class="line">service LoadBalancerStatsService {</div>
  126. <div class="line"> // Gets the backend distribution for RPCs sent by a test client.</div>
  127. <div class="line"> rpc GetClientStats(LoadBalancerStatsRequest)</div>
  128. <div class="line"> returns (LoadBalancerStatsResponse) {}</div>
  129. <div class="line">}</div>
  130. </div><!-- fragment --><p>Note that the <code>LoadBalancerStatsResponse</code> contains the remote peer distribution of the next <code>num_rpcs</code> <em>sent</em> by the client after receiving the <code>LoadBalancerStatsRequest</code>. It is important that the remote peer distribution be recorded for a block of consecutive outgoing RPCs, to validate the intended distribution from the load balancer, rather than just looking at the next <code>num_rpcs</code> responses received from backends, as different backends may respond at different rates.</p>
  131. <h1><a class="anchor" id="autotoc_md244"></a>
  132. Test Cases</h1>
  133. <h2><a class="anchor" id="autotoc_md245"></a>
  134. ping_pong</h2>
  135. <p>This test verifies that every backend receives traffic.</p>
  136. <p>Client parameters:</p>
  137. <ol type="1">
  138. <li>&ndash;num_channels=1</li>
  139. </ol>
  140. <ol type="1">
  141. <li>&ndash;qps=100</li>
  142. </ol>
  143. <ol type="1">
  144. <li>&ndash;fail_on_failed_rpc=true</li>
  145. </ol>
  146. <p>Load balancer configuration:</p>
  147. <ol type="1">
  148. <li>4 backends are created in a single managed instance group (MIG).</li>
  149. </ol>
  150. <p>Test driver asserts:</p>
  151. <ol type="1">
  152. <li>All backends receive at least one RPC</li>
  153. </ol>
  154. <h2><a class="anchor" id="autotoc_md246"></a>
  155. round_robin</h2>
  156. <p>This test verifies that RPCs are evenly routed according to an unweighted round robin policy.</p>
  157. <p>Client parameters:</p>
  158. <ol type="1">
  159. <li>&ndash;num_channels=1</li>
  160. </ol>
  161. <ol type="1">
  162. <li>&ndash;qps=100</li>
  163. </ol>
  164. <ol type="1">
  165. <li>&ndash;fail_on_failed_rpc=true</li>
  166. </ol>
  167. <p>Load balancer configuration:</p>
  168. <ol type="1">
  169. <li>4 backends are created in a single MIG.</li>
  170. </ol>
  171. <p>Test driver asserts that:</p>
  172. <ol type="1">
  173. <li>Once all backends receive at least one RPC, the following 100 RPCs are evenly distributed across the 4 backends.</li>
  174. </ol>
  175. <h2><a class="anchor" id="autotoc_md247"></a>
  176. backends_restart</h2>
  177. <p>This test verifies that the load balancer will resume sending traffic to a set of backends that is stopped and then resumed.</p>
  178. <p>Client parameters:</p>
  179. <ol type="1">
  180. <li>&ndash;num_channels=1</li>
  181. </ol>
  182. <ol type="1">
  183. <li>&ndash;qps=100</li>
  184. </ol>
  185. <p>Load balancer configuration:</p>
  186. <ol type="1">
  187. <li>4 backends are created in a single MIG.</li>
  188. </ol>
  189. <p>Test driver asserts:</p>
  190. <ol type="1">
  191. <li>All backends receive at least one RPC.</li>
  192. </ol>
  193. <p>The test driver records the peer distribution for a subsequent block of 100 RPCs then stops the backends.</p>
  194. <p>Test driver asserts:</p>
  195. <ol type="1">
  196. <li>No RPCs from the client are successful.</li>
  197. </ol>
  198. <p>The test driver resumes the backends.</p>
  199. <p>Test driver asserts:</p>
  200. <ol type="1">
  201. <li>Once all backends receive at least one RPC, the distribution for a block of 100 RPCs is the same as the distribution recorded prior to restart.</li>
  202. </ol>
  203. <h2><a class="anchor" id="autotoc_md248"></a>
  204. secondary_locality_gets_requests_on_primary_failure</h2>
  205. <p>This test verifies that backends in a secondary locality receive traffic when all backends in the primary locality fail.</p>
  206. <p>Client parameters:</p>
  207. <ol type="1">
  208. <li>&ndash;num_channels=1</li>
  209. </ol>
  210. <ol type="1">
  211. <li>&ndash;qps=100</li>
  212. </ol>
  213. <p>Load balancer configuration:</p>
  214. <ol type="1">
  215. <li>The primary MIG with 2 backends in the same zone as the client</li>
  216. </ol>
  217. <ol type="1">
  218. <li>The secondary MIG with 2 backends in a different zone</li>
  219. </ol>
  220. <p>Test driver asserts:</p>
  221. <ol type="1">
  222. <li>All backends in the primary locality receive at least 1 RPC.</li>
  223. </ol>
  224. <ol type="1">
  225. <li>No backends in the secondary locality receive RPCs.</li>
  226. </ol>
  227. <p>The test driver stops the backends in the primary locality.</p>
  228. <p>Test driver asserts:</p>
  229. <ol type="1">
  230. <li>All backends in the secondary locality receive at least 1 RPC.</li>
  231. </ol>
  232. <p>The test driver resumes the backends in the primary locality.</p>
  233. <p>Test driver asserts:</p>
  234. <ol type="1">
  235. <li>All backends in the primary locality receive at least 1 RPC.</li>
  236. </ol>
  237. <ol type="1">
  238. <li>No backends in the secondary locality receive RPCs.</li>
  239. </ol>
  240. <h2><a class="anchor" id="autotoc_md249"></a>
  241. secondary_locality_gets_no_requests_on_partial_primary_failure</h2>
  242. <p>This test verifies that backends in a failover locality do not receive traffic when at least one of the backends in the primary locality remain healthy.</p>
  243. <p><b>Note:</b> Future TD features may change the expected behavior and require changes to this test case.</p>
  244. <p>Client parameters:</p>
  245. <ol type="1">
  246. <li>&ndash;num_channels=1</li>
  247. </ol>
  248. <ol type="1">
  249. <li>&ndash;qps=100</li>
  250. </ol>
  251. <p>Load balancer configuration:</p>
  252. <ol type="1">
  253. <li>The primary MIG with 2 backends in the same zone as the client</li>
  254. </ol>
  255. <ol type="1">
  256. <li>The secondary MIG with 2 backends in a different zone</li>
  257. </ol>
  258. <p>Test driver asserts:</p>
  259. <ol type="1">
  260. <li>All backends in the primary locality receive at least 1 RPC.</li>
  261. </ol>
  262. <ol type="1">
  263. <li>No backends in the secondary locality receive RPCs.</li>
  264. </ol>
  265. <p>The test driver stops one of the backends in the primary locality.</p>
  266. <p>Test driver asserts:</p>
  267. <ol type="1">
  268. <li>All backends in the primary locality receive at least 1 RPC.</li>
  269. </ol>
  270. <ol type="1">
  271. <li>No backends in the secondary locality receive RPCs.</li>
  272. </ol>
  273. <h2><a class="anchor" id="autotoc_md250"></a>
  274. new_instance_group_receives_traffic</h2>
  275. <p>This test verifies that new instance groups added to a backend service in the same zone receive traffic.</p>
  276. <p>Client parameters:</p>
  277. <ol type="1">
  278. <li>&ndash;num_channels=1</li>
  279. </ol>
  280. <ol type="1">
  281. <li>&ndash;qps=100</li>
  282. </ol>
  283. <ol type="1">
  284. <li>&ndash;fail_on_failed_rpc=true</li>
  285. </ol>
  286. <p>Load balancer configuration:</p>
  287. <ol type="1">
  288. <li>One MIG with two backends, using rate balancing mode.</li>
  289. </ol>
  290. <p>Test driver asserts:</p>
  291. <ol type="1">
  292. <li>All backends receive at least one RPC.</li>
  293. </ol>
  294. <p>The test driver adds a new MIG with two backends in the same zone.</p>
  295. <p>Test driver asserts:</p>
  296. <ol type="1">
  297. <li>All backends in each MIG receive at least one RPC.</li>
  298. </ol>
  299. <h2><a class="anchor" id="autotoc_md251"></a>
  300. remove_instance_group</h2>
  301. <p>This test verifies that a remaining instance group can successfully serve RPCs after removal of another instance group in the same zone.</p>
  302. <p>Client parameters:</p>
  303. <ol type="1">
  304. <li>&ndash;num_channels=1</li>
  305. </ol>
  306. <ol type="1">
  307. <li>&ndash;qps=100</li>
  308. </ol>
  309. <p>Load balancer configuration:</p>
  310. <ol type="1">
  311. <li>Two MIGs with two backends each, using rate balancing mode.</li>
  312. </ol>
  313. <p>Test driver asserts:</p>
  314. <ol type="1">
  315. <li>All backends receive at least one RPC.</li>
  316. </ol>
  317. <p>The test driver removes one MIG.</p>
  318. <p>Test driver asserts:</p>
  319. <ol type="1">
  320. <li>All RPCs are directed to the two remaining backends (no RPC failures).</li>
  321. </ol>
  322. <h2><a class="anchor" id="autotoc_md252"></a>
  323. change_backend_service</h2>
  324. <p>This test verifies that the backend service can be replaced and traffic routed to the new backends.</p>
  325. <p>Client parameters:</p>
  326. <ol type="1">
  327. <li>&ndash;num_channels=1</li>
  328. </ol>
  329. <ol type="1">
  330. <li>&ndash;qps=100</li>
  331. </ol>
  332. <ol type="1">
  333. <li>&ndash;fail_on_failed_rpc=true</li>
  334. </ol>
  335. <p>Load balancer configuration:</p>
  336. <ol type="1">
  337. <li>One MIG with two backends</li>
  338. </ol>
  339. <p>Test driver asserts:</p>
  340. <ol type="1">
  341. <li>All backends receive at least one RPC.</li>
  342. </ol>
  343. <p>The test driver creates a new backend service containing a MIG with two backends and changes the TD URL map to point to this new backend service.</p>
  344. <p>Test driver asserts:</p>
  345. <ol type="1">
  346. <li>All RPCs are directed to the new backend service.</li>
  347. </ol>
  348. <h2><a class="anchor" id="autotoc_md253"></a>
  349. traffic_splitting</h2>
  350. <p>This test verifies that the traffic will be distributed between backend services with the correct weights when route action is set to weighted backend services.</p>
  351. <p>Client parameters:</p>
  352. <ol type="1">
  353. <li>&ndash;num_channels=1</li>
  354. </ol>
  355. <ol type="1">
  356. <li>&ndash;qps=100</li>
  357. </ol>
  358. <p>Load balancer configuration:</p>
  359. <ol type="1">
  360. <li>One MIG with one backend</li>
  361. </ol>
  362. <p>Assert:</p>
  363. <ol type="1">
  364. <li>Once all backends receive at least one RPC, the following 1000 RPCs are all sent to MIG_a.</li>
  365. </ol>
  366. <p>The test driver adds a new MIG with 1 backend, and changes the route action to weighted backend services with {a: 20, b: 80}.</p>
  367. <p>Assert:</p>
  368. <ol type="1">
  369. <li>Once all backends receive at least one RPC, the following 1000 RPCs are distributed across the 2 backends as a: 20, b: 80. </li>
  370. </ol>
  371. </div></div><!-- contents -->
  372. </div><!-- PageDoc -->
  373. <!-- start footer part -->
  374. <hr class="footer"/><address class="footer"><small>
  375. Generated on Sat Sep 12 2020 00:53:56 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
  376. <img class="footer" src="doxygen.png" alt="doxygen"/>
  377. </a> 1.8.17
  378. </small></address>
  379. </body>
  380. </html>