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 "". The branch, master has been updated via ef970d503456d93933dd999f17d4e744c3649292 (commit) from a1006cd6134d55de466abc073ac89e5a86cca065 (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 ef970d503456d93933dd999f17d4e744c3649292 Author: Phil Carns <[email protected]> Date: Mon Jun 4 17:30:34 2012 -0400 rpc wrapper for server to server write ----------------------------------------------------------------------- Summary of changes: code/src/replicated-osd/rosd.aer | 84 +++++++++++++++++++++++++++---------- 1 files changed, 61 insertions(+), 23 deletions(-) Diff of changes: diff --git a/code/src/replicated-osd/rosd.aer b/code/src/replicated-osd/rosd.aer index 09cc908..de6372d 100644 --- a/code/src/replicated-osd/rosd.aer +++ b/code/src/replicated-osd/rosd.aer @@ -83,6 +83,16 @@ static __blocking triton_ret_t client_rosd_s2s_create( int current_position, uint64_t niid, uint32_t flags); +static __blocking triton_ret_t client_rosd_s2s_write( + uint128_t oid, + uint64_t oid_fork, + triton_buffer_t buffer, + int64_t offset, + uint32_t flags, + uint32_t replication_factor, + uint64_t txn_number, + int current_position, + uint64_t niid); static triton_ret_t rosd_init(void) { @@ -264,9 +274,7 @@ static __blocking triton_ret_t rosd_write_do_work( triton_addr_t peer_addr) { triton_ret_t local_tret; - triton_ret_t remote_tret; - aer_remote_ctx_t rctx; - struct rosd_s2s_write_req req; + triton_ret_t remote_tret = TRITON_SUCCESS; triton_buffer_t tbuf; /* right now only chained replication is supported */ @@ -279,33 +287,18 @@ static __blocking triton_ret_t rosd_write_do_work( pbranch { /* forward on to peers if necessary */ - if(my_position == replication_factor-1) - { - /* end of the chain; no one further to forward to */ - remote_tret = TRITON_SUCCESS; - } - else + if(my_position < replication_factor-1) { triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid); triton_debug(rosd_dbg_mask, "ROSD forwarding write of oid %s to %d'th server.\n", oid_str, my_position+1); - aesop_hints_get("triton.remote.context", sizeof(rctx), &rctx); - /* TODO: error check above; we are in trouble if hint not - * found - */ - req.replication_factor = replication_factor; - req.txn_number = txn_number; + remote_tret = triton_buffer_init(&tbuf, buffer.buffer, buffer.size); if(triton_error_equal(remote_tret, TRITON_SUCCESS)) { - remote_tret = aer_init_struct_rosd_s2s_write_req( - &req, &oid, &oid_fork, &tbuf, &offset, &flags, - &replication_factor, &txn_number); - } - if(triton_error_equal(remote_tret, TRITON_SUCCESS)) - { - remote_tret = remote_rosd_s2s_write(rctx, peer_addr, &req, NULL); - aer_destroy_struct_rosd_write_req(&req); + remote_tret = client_rosd_s2s_write(oid, oid_fork, tbuf, + offset, flags, replication_factor, txn_number, + my_position, 0); } } } @@ -1156,6 +1149,51 @@ static __blocking triton_ret_t client_rosd_s2s_create( } +static __blocking triton_ret_t client_rosd_s2s_write( + uint128_t oid, + uint64_t oid_fork, + triton_buffer_t buffer, + int64_t offset, + uint32_t flags, + uint32_t replication_factor, + uint64_t txn_number, + int current_position, + uint64_t niid) +{ + struct rosd_s2s_write_req req; + triton_ret_t tret; + int retry; + uint64_t internal_niid = 0; + triton_addr_t addr; + int next_position = 0; + int critical = 0; + + tret = aer_init_struct_rosd_s2s_write_req(&req, &oid, &oid_fork, + &buffer, &offset, &flags, &replication_factor, &txn_number); + if(tret != TRITON_SUCCESS) + return(tret); + + retry = traffic_cop_rpc_control_s2s(&internal_niid, oid, replication_factor, + current_position, &next_position, &addr, &tret, &critical); + while(retry) + { + tret = remote_rosd_s2s_write(AER_DEFAULT_CTX, addr, &req, NULL); + retry = traffic_cop_rpc_control_s2s(&internal_niid, oid, replication_factor, + current_position, &next_position, &addr, &tret, &critical); + } + aer_destroy_struct_rosd_s2s_write_req(&req); + + if(critical) + { + trigger_server_fault(tret); + return(0); + } + return(tret); + +} + + + /* * Local variables: hooks/post-receive --