-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Group user network errors by error code.
Summary: Currently the code, reports network errors across all clients by error code but reports the total network error experienced by each client. It will be beneficial to group network errors per user as well by the error code. Test Plan: Run newly added unit test Reviewers: ebergen, pengt Reviewed By: pengt
- Loading branch information
Showing
10 changed files
with
385 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--echo connection_net_errors_stats_test (user= $user, ER_NET_READ_ERROR= $ER_NET_READ_ERROR, ER_NET_READ_INTERRUPTED= $ER_NET_READ_INTERRUPTED) | ||
|
||
connect (conn_stat,127.0.0.1,root); | ||
|
||
--let $mode=baseline | ||
--source include/get_user_net_error_stats.inc | ||
|
||
flush status; | ||
|
||
# Test ER_NET_READ_ERROR | ||
if ($ER_NET_READ_ERROR == 1) | ||
{ | ||
connect (conn1,127.0.0.1,$user); | ||
select "disconnect the connection"; | ||
dirty_close conn1; | ||
|
||
--source include/wait_until_disconnected.inc | ||
} | ||
|
||
# Test ER_NET_READ_INTERRUPTED | ||
if ($ER_NET_READ_INTERRUPTED == 1) | ||
{ | ||
connect (conn2,127.0.0.1,$user); | ||
set session wait_timeout = 1; | ||
--real_sleep 2 | ||
--error 2006, 2013 | ||
# Why do we check for two error codes ? | ||
# The client fails with very related error codes in different builds. The | ||
# intention of this test is to test that the server stats reflect correctly. | ||
# This is a known client side behavior and other tests like kill.test | ||
# and wait_until_connected already does the same. | ||
select "connection should have been closed by server"; | ||
disconnect conn2; | ||
} | ||
|
||
# We don't have a mechanism to trigger the following errors | ||
# ER_NET_WRITE_INTERRUPTED | ||
# ER_NET_ERROR_ON_WRITE | ||
# ER_NET_PACKET_TOO_LARGE | ||
# ER_NET_UNCOMPRESS_ERROR | ||
# ER_NET_PACKETS_OUT_OF_ORDER | ||
|
||
--connection conn_stat | ||
|
||
# Verify the counters | ||
show status like "Connection_errors_net_%"; | ||
|
||
--let $mode=compute | ||
--source include/get_user_net_error_stats.inc | ||
|
||
# Run flush status | ||
flush status; | ||
show status like "Connection_errors_net_%"; | ||
|
||
disconnect conn_stat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
let $select_errors_net_total = select errors_net_total from information_schema.user_statistics where user_name="$user"; | ||
let $select_errors_net_ER_NET_ERROR_ON_WRITE = select | ||
errors_net_ER_NET_ERROR_ON_WRITE from information_schema.user_statistics where | ||
user_name="$user"; | ||
let $select_errors_net_ER_NET_PACKETS_OUT_OF_ORDER = select errors_net_ER_NET_PACKETS_OUT_OF_ORDER from information_schema.user_statistics where user_name="$user"; | ||
let $select_errors_net_ER_NET_PACKET_TOO_LARGE = select errors_net_ER_NET_PACKET_TOO_LARGE from information_schema.user_statistics where user_name="$user"; | ||
let $select_errors_net_ER_NET_READ_ERROR = select errors_net_ER_NET_READ_ERROR from information_schema.user_statistics where user_name="$user"; | ||
let $select_errors_net_ER_NET_READ_INTERRUPTED = select errors_net_ER_NET_READ_INTERRUPTED from information_schema.user_statistics where user_name="$user"; | ||
let $select_errors_net_ER_NET_UNCOMPRESS_ERROR = select errors_net_ER_NET_UNCOMPRESS_ERROR from information_schema.user_statistics where user_name="$user"; | ||
let $select_errors_net_ER_NET_WRITE_INTERRUPTED = select errors_net_ER_NET_WRITE_INTERRUPTED from information_schema.user_statistics where user_name="$user"; | ||
|
||
if ($mode == 'baseline') | ||
{ | ||
--let $base_errors_net_total = query_get_value($select_errors_net_total, errors_net_total, 1) | ||
--let $base_errors_net_ER_NET_ERROR_ON_WRITE = query_get_value($select_errors_net_ER_NET_ERROR_ON_WRITE, errors_net_ER_NET_ERROR_ON_WRITE, 1) | ||
--let $base_errors_net_ER_NET_PACKETS_OUT_OF_ORDER = query_get_value($select_errors_net_ER_NET_PACKETS_OUT_OF_ORDER, errors_net_ER_NET_PACKETS_OUT_OF_ORDER, 1) | ||
--let $base_errors_net_ER_NET_PACKET_TOO_LARGE = query_get_value($select_errors_net_ER_NET_PACKET_TOO_LARGE, errors_net_ER_NET_PACKET_TOO_LARGE, 1) | ||
--let $base_errors_net_ER_NET_READ_ERROR = query_get_value($select_errors_net_ER_NET_READ_ERROR, errors_net_ER_NET_READ_ERROR, 1) | ||
--let $base_errors_net_ER_NET_READ_INTERRUPTED = query_get_value($select_errors_net_ER_NET_READ_INTERRUPTED, errors_net_ER_NET_READ_INTERRUPTED, 1) | ||
--let $base_errors_net_ER_NET_UNCOMPRESS_ERROR = query_get_value($select_errors_net_ER_NET_UNCOMPRESS_ERROR, errors_net_ER_NET_UNCOMPRESS_ERROR, 1) | ||
--let $base_errors_net_ER_NET_WRITE_INTERRUPTED = query_get_value($select_errors_net_ER_NET_WRITE_INTERRUPTED, errors_net_ER_NET_WRITE_INTERRUPTED, 1) | ||
} | ||
|
||
if ($mode == 'compute') | ||
{ | ||
--let $errors_net_total = query_get_value($select_errors_net_total, errors_net_total, 1) | ||
--let $errors_net_ER_NET_ERROR_ON_WRITE = query_get_value($select_errors_net_ER_NET_ERROR_ON_WRITE, errors_net_ER_NET_ERROR_ON_WRITE, 1) | ||
--let $errors_net_ER_NET_PACKETS_OUT_OF_ORDER = query_get_value($select_errors_net_ER_NET_PACKETS_OUT_OF_ORDER, errors_net_ER_NET_PACKETS_OUT_OF_ORDER, 1) | ||
--let $errors_net_ER_NET_PACKET_TOO_LARGE = query_get_value($select_errors_net_ER_NET_PACKET_TOO_LARGE, errors_net_ER_NET_PACKET_TOO_LARGE, 1) | ||
--let $errors_net_ER_NET_READ_ERROR = query_get_value($select_errors_net_ER_NET_READ_ERROR, errors_net_ER_NET_READ_ERROR, 1) | ||
--let $errors_net_ER_NET_READ_INTERRUPTED = query_get_value($select_errors_net_ER_NET_READ_INTERRUPTED, errors_net_ER_NET_READ_INTERRUPTED, 1) | ||
--let $errors_net_ER_NET_UNCOMPRESS_ERROR = query_get_value($select_errors_net_ER_NET_UNCOMPRESS_ERROR, errors_net_ER_NET_UNCOMPRESS_ERROR, 1) | ||
--let $errors_net_ER_NET_WRITE_INTERRUPTED = query_get_value($select_errors_net_ER_NET_WRITE_INTERRUPTED, errors_net_ER_NET_WRITE_INTERRUPTED, 1) | ||
|
||
--disable_query_log | ||
eval select $errors_net_total - $base_errors_net_total into @errors_net_total; | ||
eval select $errors_net_ER_NET_ERROR_ON_WRITE - $base_errors_net_ER_NET_ERROR_ON_WRITE into @errors_net_ER_NET_ERROR_ON_WRITE; | ||
eval select $errors_net_ER_NET_PACKETS_OUT_OF_ORDER - $base_errors_net_ER_NET_PACKETS_OUT_OF_ORDER into @errors_net_ER_NET_PACKETS_OUT_OF_ORDER; | ||
eval select $errors_net_ER_NET_PACKET_TOO_LARGE - $base_errors_net_ER_NET_PACKET_TOO_LARGE into @errors_net_ER_NET_PACKET_TOO_LARGE; | ||
eval select $errors_net_ER_NET_READ_ERROR - $base_errors_net_ER_NET_READ_ERROR into @errors_net_ER_NET_READ_ERROR; | ||
eval select $errors_net_ER_NET_READ_INTERRUPTED - $base_errors_net_ER_NET_READ_INTERRUPTED into @errors_net_ER_NET_READ_INTERRUPTED; | ||
eval select $errors_net_ER_NET_UNCOMPRESS_ERROR - $base_errors_net_ER_NET_UNCOMPRESS_ERROR into @errors_net_ER_NET_UNCOMPRESS_ERROR; | ||
eval select $errors_net_ER_NET_WRITE_INTERRUPTED - $base_errors_net_ER_NET_WRITE_INTERRUPTED into @errors_net_ER_NET_WRITE_INTERRUPTED; | ||
|
||
--enable_query_log | ||
select @errors_net_total; | ||
select @errors_net_ER_NET_ERROR_ON_WRITE; | ||
select @errors_net_ER_NET_PACKETS_OUT_OF_ORDER; | ||
select @errors_net_ER_NET_PACKET_TOO_LARGE; | ||
select @errors_net_ER_NET_READ_ERROR; | ||
select @errors_net_ER_NET_READ_INTERRUPTED; | ||
select @errors_net_ER_NET_UNCOMPRESS_ERROR; | ||
select @errors_net_ER_NET_WRITE_INTERRUPTED; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.