feat: implement lab3 API load balancing and failover
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
Traceback (most recent call last):
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 1348, in do_open
|
||||
h.request(req.get_method(), req.selector, req.data, headers,
|
||||
File "/usr/local/lib/python3.11/http/client.py", line 1351, in request
|
||||
self._send_request(method, url, body, headers, encode_chunked)
|
||||
File "/usr/local/lib/python3.11/http/client.py", line 1397, in _send_request
|
||||
self.endheaders(body, encode_chunked=encode_chunked)
|
||||
File "/usr/local/lib/python3.11/http/client.py", line 1346, in endheaders
|
||||
self._send_output(message_body, encode_chunked=encode_chunked)
|
||||
File "/usr/local/lib/python3.11/http/client.py", line 1106, in _send_output
|
||||
self.send(msg)
|
||||
File "/usr/local/lib/python3.11/http/client.py", line 1044, in send
|
||||
self.connect()
|
||||
File "/usr/local/lib/python3.11/http/client.py", line 1010, in connect
|
||||
self.sock = self._create_connection(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/local/lib/python3.11/socket.py", line 863, in create_connection
|
||||
raise exceptions[0]
|
||||
File "/usr/local/lib/python3.11/socket.py", line 848, in create_connection
|
||||
sock.connect(sa)
|
||||
ConnectionRefusedError: [Errno 111] Connection refused
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "<string>", line 1, in <module>
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 216, in urlopen
|
||||
return opener.open(url, data, timeout)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 519, in open
|
||||
response = self._open(req, data)
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 536, in _open
|
||||
result = self._call_chain(self.handle_open, protocol, protocol +
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 496, in _call_chain
|
||||
result = func(*args)
|
||||
^^^^^^^^^^^
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 1377, in http_open
|
||||
return self.do_open(http.client.HTTPConnection, req)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/local/lib/python3.11/urllib/request.py", line 1351, in do_open
|
||||
raise URLError(err)
|
||||
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
|
||||
{
|
||||
"mode": "failover",
|
||||
"result": "PASS",
|
||||
"instances_before": [
|
||||
"0fa5e6d8-e471-4f44-992c-42c530dceb1f",
|
||||
"d2f38075-ad18-4b40-b025-0b6b75b5deec"
|
||||
],
|
||||
"duration_seconds": 16.683,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 4803,
|
||||
"errors": 366,
|
||||
"error_ratio": 0.070807,
|
||||
"successful_rps": 287.901,
|
||||
"successful_latency_ms": {
|
||||
"p50": 9.761,
|
||||
"p95": 25.936,
|
||||
"p99": 69.031
|
||||
},
|
||||
"first_success_after_action_seconds": 3.277,
|
||||
"action_duration_seconds": 3.206,
|
||||
"confirmed_checked": 4804,
|
||||
"lost_confirmed": 0,
|
||||
"read_write_original_session": "PASS",
|
||||
"action": {
|
||||
"target_container": "7d2957677a353afd40753a1fd04d09df9e9029260ee3572b1a73822525b2ca9b",
|
||||
"target_instance": "d2f38075-ad18-4b40-b025-0b6b75b5deec",
|
||||
"hook_output": "Stopping API container 7d2957677a353afd40753a1fd04d09df9e9029260ee3572b1a73822525b2ca9b instance d2f38075-ad18-4b40-b025-0b6b75b5deec\nFlag --time has been deprecated, use --timeout instead\n7d2957677a353afd40753a1fd04d09df9e9029260ee3572b1a73822525b2ca9b",
|
||||
"target_running_after_hook": false
|
||||
},
|
||||
"method": "4 closed-loop writers through LB; errors counted, no retry; full history after action. Recovery includes hook duration and next fresh write.",
|
||||
"instances_after_restore": [
|
||||
"0fa5e6d8-e471-4f44-992c-42c530dceb1f",
|
||||
"fc7e5f78-28a9-43fc-a235-02f560dbed14"
|
||||
],
|
||||
"recorded_at_utc": "2026-11-05T21:29:22.573332+00:00"
|
||||
}
|
||||
Reference in New Issue
Block a user