This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, master has been updated via 491f2184433fb34964441896eeb46438a8a32b0e (commit) via 3efa5d031c01f490db82e437f50303b697e4318b (commit) via f19838ae1bc4454d81064c05baab78b26781110a (commit) via a0077b6f4b0eb88ba5897e93a236cf54a8488e59 (commit) via 5819013c743cac1713233d445f4c74b8dbb6a9af (commit) via 3211188196d233f2703e84c0e214ca479c58554e (commit) via cbecc195acd8aadeebaa2ecb6e1084b790aba73a (commit) from 154add162e1b6d7cd3d231a3c1b4d28d23b9d601 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 491f2184433fb34964441896eeb46438a8a32b0e Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 11:00:52 2011 -0500 const warning fix commit 3efa5d031c01f490db82e437f50303b697e4318b Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 10:50:19 2011 -0500 ROSD fault injection test works commit f19838ae1bc4454d81064c05baab78b26781110a Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 10:48:17 2011 -0500 Include zeroconf commit a0077b6f4b0eb88ba5897e93a236cf54a8488e59 Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 10:47:59 2011 -0500 Drop const commit 5819013c743cac1713233d445f4c74b8dbb6a9af Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 10:27:58 2011 -0500 Ensure traffic-cop is initialized before using it commit 3211188196d233f2703e84c0e214ca479c58554e Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 09:22:51 2011 -0500 Add new states from meeting discussion commit cbecc195acd8aadeebaa2ecb6e1084b790aba73a Author: Justin Wozniak <[email protected]> Date: Tue Jun 7 09:21:39 2011 -0500 Note ----------------------------------------------------------------------- Summary of changes: code/src/common/traffic-cop.ae | 7 ++++- code/src/state/state-client.aer | 6 ++++ code/src/state/state.ae | 51 +++++++++++++++----------------- code/src/state/state.hae | 6 ++- code/src/state/test/rosd-injection.ae | 22 +++++++++++-- code/src/state/test/rosd-injection.sh | 8 +++-- 6 files changed, 63 insertions(+), 37 deletions(-) Diff of changes: diff --git a/code/src/common/traffic-cop.ae b/code/src/common/traffic-cop.ae index c9467be..b64977c 100644 --- a/code/src/common/traffic-cop.ae +++ b/code/src/common/traffic-cop.ae @@ -13,6 +13,8 @@ static int static_timeout = 0; static triton_mutex_t current_token_mutex = TRITON_MUTEX_INITIALIZER; static int current_token = 0; +static int initialized = 0; + /* how long to delay before telling the caller to re-map the remote * operation to a server */ @@ -35,6 +37,8 @@ __blocking triton_ret_t traffic_cop_query( { int timeout; + assert(initialized); + /* TODO: fill in this function */ if(retry_count > 5) { @@ -160,7 +164,7 @@ static triton_ret_t static_timeout_update(const char *key, const char *value) static triton_ret_t traffic_cop_init(void) { triton_ret_t tret; - + tret = triton_zeroconf_register("triton.traffic_cop.static_timeout", "0", static_timeout_update, "A static timeout can be set in the traffic cop (in millisecs)." " A value of 0 (default) disables the static timeout."); @@ -175,6 +179,7 @@ static triton_ret_t traffic_cop_init(void) return(tret); } + initialized = 1; return(TRITON_SUCCESS); } diff --git a/code/src/state/state-client.aer b/code/src/state/state-client.aer index 8a8146a..d9939ad 100644 --- a/code/src/state/state-client.aer +++ b/code/src/state/state-client.aer @@ -14,6 +14,8 @@ #include "src/remote/service.hae" +#include "src/zeroconf/zeroconf.h" + static triton_debug_mask_t debug; static triton_ret_t state_client_init(void) @@ -130,6 +132,10 @@ static void handle_state_change(triton_status_t *status) return; } +/** + Setting the status to INJECTED will prevent this from + returning the RPC successfully. +*/ __remote __blocking triton_ret_t state_client_admin_status_set( int32_t *status, triton_ignore_t *ignore) diff --git a/code/src/state/state.ae b/code/src/state/state.ae index b575b5f..28230c3 100644 --- a/code/src/state/state.ae +++ b/code/src/state/state.ae @@ -5,39 +5,36 @@ struct triton_state_funcs triton_state; triton_status_t triton_status = TRITON_STATUS_PROTO; -triton_ret_t triton_status_tostring(const triton_string_t *result, +triton_ret_t triton_status_tostring(triton_string_t *result, triton_status_t status) { - char *s = NULL; - switch (status) { - case TRITON_STATUS_PROTO: - s = "PROTO"; - break; - case TRITON_STATUS_NOMINAL: - s ="NOMINAL"; - break; - case TRITON_STATUS_RECOVERY: - s = "RECOVERY"; - break; - case TRITON_STATUS_MAINTENANCE: - s = "MAINTENANCE"; - break; - case TRITON_STATUS_INJECTED: - s = "INJECTED"; - break; - case TRITON_STATUS_FAILED: - s = "FAILED"; - break; - } - - if (s == NULL) - { - return TRITON_ERR_INVAL; + case TRITON_STATUS_PROTO: + triton_string_init(result, "PROTO"); + break; + case TRITON_STATUS_NOMINAL: + triton_string_init(result, "NOMINAL"); + break; + case TRITON_STATUS_NOMINAL_REBUILD: + triton_string_init(result, "NOMINAL_REBUILD"); + break; + case TRITON_STATUS_RECOVERY: + triton_string_init(result, "RECOVERY"); + break; + case TRITON_STATUS_MAINTENANCE: + triton_string_init(result, "MAINTENANCE"); + break; + case TRITON_STATUS_INJECTED: + triton_string_init(result, "INJECTED"); + break; + case TRITON_STATUS_UNREACHABLE: + triton_string_init(result, "UNREACHABLE"); + break; + default: + return TRITON_ERR_INVAL; } - triton_string_init(result, s); return TRITON_SUCCESS; } diff --git a/code/src/state/state.hae b/code/src/state/state.hae index 088473b..8cb34bd 100644 --- a/code/src/state/state.hae +++ b/code/src/state/state.hae @@ -89,6 +89,8 @@ typedef enum TRITON_STATUS_PROTO, /** The node is healthy */ TRITON_STATUS_NOMINAL, + /** The node is healthy but is participating in a rebuild */ + TRITON_STATUS_NOMINAL_REBUILD, /** The node is recovering metadata from neighbors */ TRITON_STATUS_RECOVERY, /** The node is unable to serve requests */ @@ -96,12 +98,12 @@ typedef enum /** The node is in a simulated FAILED state */ TRITON_STATUS_INJECTED, /** The node is out of the system */ - TRITON_STATUS_FAILED + TRITON_STATUS_UNREACHABLE } triton_status_t; extern triton_status_t triton_status; -triton_ret_t triton_status_tostring(const triton_string_t *result, +triton_ret_t triton_status_tostring(triton_string_t *result, triton_status_t status); #endif diff --git a/code/src/state/test/rosd-injection.ae b/code/src/state/test/rosd-injection.ae index f309d93..8daad36 100644 --- a/code/src/state/test/rosd-injection.ae +++ b/code/src/state/test/rosd-injection.ae @@ -60,6 +60,8 @@ char *hostfile; int mpi_rank; +static bool do_remote_noop_result = false; + /* __blocking void update_state() { @@ -131,6 +133,8 @@ __blocking void do_remote_shutdown(void) pbranch { ret = remote_triton_core_server_shutdown(AER_DEFAULT_CTX, mapping->addr, in, &out); + // This assertion is expected to fail: the unreachable server + // cannot be shut down triton_error_assert(ret); } } @@ -162,6 +166,7 @@ __blocking void do_remote_server(void) assert(nprocs > 1); // triton_debug_enable("/dev/stdout", "triton.fakess"); + triton_debug_enable("/dev/stdout", "net.fault"); triton_fakess_state_install(); pwait @@ -197,6 +202,9 @@ __blocking void do_remote_server(void) } #endif +/** + This function sets a success value in do_remote_noop_result +*/ __blocking void do_remote_noop(void) { triton_ret_t ret; @@ -256,16 +264,21 @@ __blocking void do_remote_noop(void) triton_timer(mpi_rank*1000-2000); ret = remote_state_client_admin_status_set (AER_DEFAULT_CTX, svr_addr, status, NULL); - triton_error_assert(ret); + if (ret != TRITON_ERR_CANCELED) + return; ret = remote_triton_core_noop(AER_DEFAULT_CTX, svr_addr, NULL, NULL); - triton_error_assert(ret); + if (ret != TRITON_ERR_CANCELED) + return; triton_mutex_lock(&oid_mutex); } triton_mutex_unlock(&oid_mutex); } } } + + do_remote_noop_result = true; + return; } static int done = 0; @@ -375,7 +388,7 @@ int main(int argc, char *argv[]) triton_error_assert(ret); /* servers */ - ret = triton_init("triton.server"); + ret = triton_init("triton.server", "triton.traffic_cop"); triton_error_assert(ret); ret = aer_remote_register_rosd(); triton_error_assert(ret); @@ -387,7 +400,7 @@ int main(int argc, char *argv[]) else { /* clients */ - ret = triton_init("triton.client"); + ret = triton_init("triton.client", "triton.traffic_cop"); triton_error_assert(ret); } @@ -454,6 +467,7 @@ int main(int argc, char *argv[]) { ae_poll(NULL, CLIENT_POLL_TIMEOUT); } + assert(do_remote_noop_result); ae_hints_destroy(&hints); test_end = MPI_Wtime(); noop_elapsed = test_end - test_start; diff --git a/code/src/state/test/rosd-injection.sh b/code/src/state/test/rosd-injection.sh index 3026073..e3660b9 100755 --- a/code/src/state/test/rosd-injection.sh +++ b/code/src/state/test/rosd-injection.sh @@ -8,17 +8,19 @@ OUT=${BIN}.out export triton_fakess_method=fault export aesop_remote_default_net=fault +export triton_traffic_cop_static_timeout=10 # Test with sorted input... mpiexec -l -n 4 ${VALGRIND} ${BIN} /tmp/rosd.db /tmp/rosd-log \ 1 1 0 0 2 1 src/mapping/test/faulty2.txt > ${OUT} 2>&1 -[[ $? == 0 ]] || exit 1 +# This is expected to fail +[[ $? != 0 ]] || exit 1 LINES=$( grep "status change:" ${OUT} | wc -l ) [[ $? == 0 ]] || exit 1 -[[ ${LINES} == 6 ]] || exit 1 +[[ ${LINES} == 5 ]] || exit 1 -grep "entering faulty state" ${OUT} | exit 1 +grep "entering faulty state" ${OUT} || exit 1 echo OK exit 0 hooks/post-receive -- Triton Repository