An error occurred fetching the project authors.
- 30 Sep, 2009 1 commit
-
-
Ingo Struewing authored
We cann connect() in a non-blocking mode to be able to specify a non-standard timeout. The problem was that we did not fetch the status from the non-blocking connect(). We assumed that poll() would not return a POLLIN flag if the connect failed. But on some platforms this is not true. After a successful poll() we do now retrieve the status value from connect() with getsockopt(...SO_ERROR...). Now we do know if (and how) the connect failed. The test case for my investigation was rpl.rlp_ssl1 on an Ubuntu 9.04 x86_64 machine. Both, IPV4 and IPV6 were active. 'localhost' resolved first for IPV6 and then for IPV4. The connection over IPV6 was blocked. rpl.rlp_ssl1 timed out as it did not notice the failed connect(). The first read() failed, which was interpreted as a master crash and the connection was tried to reestablish with the same result until the retry limit was reached. With the fix, the connect() problem is immediately recognized, and the connect() is retried on the second resolution for 'localhost', which is successful. libmysqld/libmysqld.c: Bug#37267 - connect() EINPROGRESS failures mishandled in client library Changed a DBUG print string to distinguish the two mysql_real_connect() implementations in DBUG traces. mysql-test/include/wait_for_slave_param.inc: Bug#37267 - connect() EINPROGRESS failures mishandled in client library Made timeout value available in error message. mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result: Bug#37267 - connect() EINPROGRESS failures mishandled in client library Fixed test result. Connect error is now detected as CR_CONN_HOST_ERROR (2003) instead of CR_SERVER_LOST (2013). sql-common/client.c: Bug#37267 - connect() EINPROGRESS failures mishandled in client library Added retrieval of the error code from the non-blocking connect(). Added DBUG. Added comment.
-
- 09 Jan, 2009 1 commit
-
-
Sven Sandberg authored
Problem 1: The test waits for an error in the slave sql thread, then resolves the error and issues 'start slave'. However, there is a gap between when the error is reported and the slave sql thread stops. If this gap was long, the slave would still be running when 'start slave' happened, so 'start slave' would fail and cause a test failure. Fix 1: Made wait_for_slave_sql_error wait for the slave to stop instead of wait for error in the IO thread. After stopping, the error code is verified. If the error code is wrong, debug info is printed. To print debug info, the debug printing code in wait_for_slave_param.inc was moved out to a new file, show_rpl_debug_info.inc. Problem 2: rpl_stm_mystery22 is a horrible name, the comments in the file didn't explain anything useful, the test was generally hard to follow, and the test was essentially duplicated between rpl_stm_mystery22 and rpl_row_mystery22. Fix 2: The test is about conflicts in the slave SQL thread, hence I renamed the tests to rpl_{stm,row}_conflicts. Refactored the test so that the work is done in extra/rpl_tests/rpl_conflicts.inc, and rpl.rpl_{row,stm}_conflicts merely sets some variables and then sourced extra/rpl_tests/rpl_conflicts.inc. The tests have been rewritten and comments added. Problem 3: When calling wait_for_slave_sql_error.inc, you always want to verify that the sql thread stops because of the expected error and not because of some other error. Currently, wait_for_slave_sql_error.inc allows the caller to omit the error code, in which case all error codes are accepted. Fix 3: Made wait_for_slave_sql_error.inc fail if no error code is given. Updated rpl_filter_tables_not_exist accordingly. Problem 4: rpl_filter_tables_not_exist had a typo, the dollar sign was missing in a 'let' statement. Fix 4: Added dollar sign. Problem 5: When replicating from other servers than the one named 'master', the wait_for_slave_* macros were unable to print debug info on the master. Fix 5: Replace parameter $slave_keep_connection by $master_connection. mysql-test/extra/rpl_tests/rpl_conflicts.test: rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed: The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test just set some parameters, and then source include/rpl_tests/rpl_conflicts.test. Also, cleaned up the test case a bit, and fixed BUG#37718. mysql-test/include/show_rpl_debug_info.inc: Factored out the debug printing code from wait_for_slave_param.inc to a new file, show_rpl_debug_info.inc. Also removed the $slave_keep_connection parameter, and replaced it by $master_connection. This allows printing debug info on the master, no matter what the name of the master connection is. mysql-test/include/start_slave.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/stop_slave.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/sync_slave_io_with_master.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_io_to_start.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_io_to_stop.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_param.inc: Factored out the debug printing code from wait_for_slave_param.inc to a new file, show_rpl_debug_info.inc. Also removed the $slave_keep_connection parameter, and replaced it by $master_connection. This allows printing debug info on the master, no matter what the name of the master connection is. Had to move the printing of debug info out of the while loop because of BUG number 41913. mysql-test/include/wait_for_slave_sql_error.inc: Made it wait until the slave sql thread has stopped. This takes very short time and avoids race condition bugs in test cases (e.g., fixes BUG#37718). Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_sql_error_and_skip.inc: Since wait_for_slave_sql_error now waits for the slave sql thread to stop too, wait_for_slave_sql_error_and_skip does not have to wait for the slave sql thread to stop. Also, since wait_for_slave_sql_error now requires the parameter $slave_sql_errno to be set, wait_for_slave_sql_error_and_skip requires that as well: updated the usage instructions. mysql-test/include/wait_for_slave_sql_to_start.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_sql_to_stop.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_to_start.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/include/wait_for_slave_to_stop.inc: Replaced $slave_keep_connection by $master_connection. mysql-test/suite/rpl/r/rpl_row_conflicts.result: update result file mysql-test/suite/rpl/r/rpl_stm_conflicts.result: update result file mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Replaced $slave_keep_connection by $master_connection. mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test: Set $slave_sql_errno, since it is now required. Add dollar sign to $show_sql_error (without dollar sign, mtr makes it an environment variable). mysql-test/suite/rpl/t/rpl_row_conflicts.test: rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed: The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test just set some parameters, and then source include/rpl_tests/rpl_conflicts.test. Also, cleaned up the test case a bit, and fixed BUG#37718. mysql-test/suite/rpl/t/rpl_row_mystery22.test: rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed: The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test just set some parameters, and then source include/rpl_tests/rpl_conflicts.test. Also, cleaned up the test case a bit, and fixed BUG#37718. mysql-test/suite/rpl/t/rpl_stm_conflicts.test: rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed: The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test just set some parameters, and then source include/rpl_tests/rpl_conflicts.test. Also, cleaned up the test case a bit, and fixed BUG#37718.
-
- 10 Jul, 2008 1 commit
-
-
Sven Sandberg authored
Problem 1: tests often fail in pushbuild with a timeout when waiting for the slave to start/stop/receive error. Fix 1: Updated the wait_for_slave_* macros in the following way: - The timeout is increased by a factor ten - Refactored the macros so that wait_for_slave_param does the work for the other macros. Problem 2: Tests are often incorrectly written, lacking a source include/wait_for_slave_to_[start|stop].inc. Fix 2: Improved the chance to get it right by adding include/start_slave.inc and include/stop_slave.inc, and updated tests to use these. Problem 3: The the built-in test language command wait_for_slave_to_stop is a misnomer (does not wait for the slave io thread) and does not give as much debug info in case of failure as the otherwise equivalent macro source include/wait_for_slave_sql_to_stop.inc Fix 3: Replaced all calls to the built-in command by a call to the macro. Problem 4: Some, but not all, of the wait_for_slave_* macros had an implicit connection slave. This made some tests confusing to read, and made it more difficult to use the macro in circular replication scenarios, where the connection named master needs to wait. Fix 4: Removed the implicit connection slave from all wait_for_slave_* macros, and updated tests to use an explicit connection slave where necessary. Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc were unused. Moreover, using them is difficult and error-prone. Fix 5: remove these macros. Problem 6: log_bin_trust_function_creators_basic failed when running tests because it assumed @@global.log_bin_trust_function_creators=1, and some tests modified this variable without resetting it to its original value. Fix 6: All tests that use this variable have been updated so that they reset the value at end of test. mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test: Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc Added connection slave since includ/wait_for_slave_sql_to_stop.inc does not do that anymore. mysql-test/extra/rpl_tests/rpl_log.test: Replaced start slave+wait_slave_status by start_slave.inc mysql-test/include/reset_master_and_slave.inc: replaced start/stop slave by start_slave.inc/stop_slave.inc mysql-test/include/sync_slave_io_with_master.inc: Improved comments and error message. mysql-test/include/wait_for_slave_io_to_stop.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_param.inc: - Improved usage instructions - Added more debug info in case of timeout - Added parameters $slave_param_comparison, $slave_timeout, $slave_keep_connection, $slave_error_message mysql-test/include/wait_for_slave_sql_error.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_sql_to_start.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_sql_to_stop.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_to_start.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_to_stop.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_show_pattern.inc: Removed unused (and error-prone) file mysql-test/include/wait_slave_status.inc: Removed unused (and error-prone) file mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test: Renamed $keep_connection to $slave_keep_connection. mysql-test/suite/rpl/t/rpl_bug26395.test: Replace stop slave by stop_slave.inc mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test: Replace start/stop slave by start_slave.inc/stop_slave.inc. Replace wait_for_slave_param by wait_for_slave_sql_to_stop.inc. mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Renamed $keep_connection to $slave_keep_connection. mysql-test/suite/rpl/t/rpl_flushlog_loop.test: Replace wait_slave_status by start_slave.inc mysql-test/suite/rpl/t/rpl_idempotency.test: Added connection slave since wait_for_slave_sql_to_stop.inc does not do that any more. mysql-test/suite/rpl/t/rpl_incident.test: Replaced wait_for_slave_to_stop by wait_for_slave_sql_to_stop.inc mysql-test/suite/rpl/t/rpl_init_slave.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced save_master_pos;connection slave;sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_log_pos.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced wait_for_slave_param by other wait_for_slave_* macros. mysql-test/suite/rpl/t/rpl_packet.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_row_until.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced save_master_pos;connection slave;sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_server_id1.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_slave_grp_exec.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_slave_skip.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_slave_status.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_sp.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/suite/rpl/t/rpl_sp_effects.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/suite/rpl/t/rpl_stm_until.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced save_master_pos;connection slave;sync_with_master by sync_slave_with_master. mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: Replaced start slave by start_slave.inc. Added explicit connection slave since wait_for_slave_sql_to_stop.inc does not do that anymore. mysql-test/t/disabled.def: Disabled failing test. mysql-test/t/func_time.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/grant.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/grant2.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/innodb_notembedded.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/log_bin_trust_function_creators_func.test: Restore @@global.log_bin_trust_function_creators at end of test. Clean up at end of test by dropping the created user. mysql-test/t/query_cache.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/query_cache_notembedded.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/rpl_init_slave_func.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/t/timezone2.test: Restore @@global.log_bin_trust_function_creators at end of test.
-
- 15 Jun, 2007 1 commit
-
-
unknown authored
Problem: show slave status may return different Slave_IO_Running values running some tests. Fix: wait for a certain slave state if needed to get tests more predictable. mysql-test/r/rpl_log_pos.result: Fix for bug #28144: "Slave_IO_Running" differs in replication tests - test result adjusted. mysql-test/r/rpl_ssl.result: Fix for bug #28144: "Slave_IO_Running" differs in replication tests - test result adjusted. mysql-test/t/rpl_log_pos.test: Fix for bug #28144: "Slave_IO_Running" differs in replication tests - test has been rewritten to get certain slave state, now we use wait_for_slave_param.inc to ensure we get proper IO/SQL slave's threads states. mysql-test/t/rpl_ssl.test: Fix for bug #28144: "Slave_IO_Running" differs in replication tests - wait_for_slave_to_start.inc used to get certain slave states in order to be more predictable. mysql-test/include/wait_for_slave_param.inc: New BitKeeper file ``mysql-test/include/wait_for_slave_param.inc'' allow to wait until SHOW SLAVE STATUS has returned a spicified value.
-