diff options
author | David Boreham <dboreham@redhat.com> | 2005-05-04 23:58:51 +0000 |
---|---|---|
committer | David Boreham <dboreham@redhat.com> | 2005-05-04 23:58:51 +0000 |
commit | 7962fb59d109d06de437d658e713edf99d6acd19 (patch) | |
tree | 210eec686c009ea101e01211d07dc7e63de3c946 | |
parent | 0fd4415e2a4995b2d64aa77120d7158472026f86 (diff) | |
download | ds-7962fb59d109d06de437d658e713edf99d6acd19.tar.gz ds-7962fb59d109d06de437d658e713edf99d6acd19.tar.xz ds-7962fb59d109d06de437d658e713edf99d6acd19.zip |
Allow error on result side to propagate pack to sending side
-rw-r--r-- | ldap/servers/plugins/replication/repl5_inc_protocol.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c index 933a78a9..276ab4f0 100644 --- a/ldap/servers/plugins/replication/repl5_inc_protocol.c +++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c @@ -98,6 +98,7 @@ typedef struct result_data int stop_result_thread; /* Flag used to tell the result thread to exit */ int last_message_id_sent; int last_message_id_received; + int result; /* The UPDATE_TRANSIENT_ERROR etc */ } result_data; /* Various states the incremental protocol can pass through */ @@ -263,6 +264,7 @@ static void repl5_inc_result_threadmain(void *param) int finished = 0; int message_id = 0; + slapi_log_error(SLAPI_LOG_REPL, NULL, "repl5_inc_result_threadmain starting\n"); while (!finished) { repl5_inc_operation *op = NULL; @@ -336,25 +338,11 @@ static void repl5_inc_result_threadmain(void *param) } conn_get_error_ex(conn, &operation_code, &connection_error, &ldap_error_string); - /* Back out of harmless errors here */ - if (ignore_error_and_keep_going(connection_error)) - { - char *op_string = slapi_op_type_to_string(operation_code); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "%s: Ignoring error %d: %s for %s operation\n", - agmt_get_long_name(rd->prp->agmt), - connection_error, ldap_error_string ? ldap_error_string : "NULL", - op_string ? op_string : "NULL"); - connection_error = 0; - conres = 0; - } - if (connection_error) - { - repl5_inc_log_operation_failure(op ? op->operation_type : 0, connection_error, ldap_error_string, agmt_get_long_name(rd->prp->agmt)); - } - res = repl5_inc_update_from_op_result(rd->prp, conres, connection_error, csn_str, uniqueid, replica_id, &finished, &(rd->num_changes_sent)); - if (0 != conres) + slapi_log_error(SLAPI_LOG_REPL, NULL, "repl5_inc_result_threadmain: result %d, %d, %d, %s\n", operation_code,connection_error,conres,ldap_error_string); + rd->result = repl5_inc_update_from_op_result(rd->prp, conres, connection_error, csn_str, uniqueid, replica_id, &finished, &(rd->num_changes_sent)); + if (rd->result) { + slapi_log_error(SLAPI_LOG_REPL, NULL, "repl5_inc_result_threadmain: got op result %d\n", rd->result); /* If so then we need to take steps to abort the update process */ PR_Lock(rd->lock); rd->abort = 1; @@ -374,6 +362,7 @@ static void repl5_inc_result_threadmain(void *param) repl5_inc_op_free(op); } } + slapi_log_error(SLAPI_LOG_REPL, NULL, "repl5_inc_result_threadmain exiting\n"); } static result_data * @@ -1914,6 +1903,12 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_YIELD; finished = 1; } + /* See if the result thread has hit a problem */ + if (!finished && rd->abort) + { + return_value = rd->result; + finished = 1; + } } while (!finished); /* Terminate the results reading thread */ |