Triton Repository branch, master, updated. b766dbe7eb8df3a4648827c202a8113f15322091
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 b766dbe7eb8df3a4648827c202a8113f15322091 (commit) from 10d474c070b743303810d89f7514f3d06a885153 (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 b766dbe7eb8df3a4648827c202a8113f15322091 Author: Phil Carns <[email protected]> Date: Fri Oct 29 09:44:12 2010 -0400 exposed truncate on write flag through ROSD ----------------------------------------------------------------------- Summary of changes: code/src/kv/kv.aer | 7 ++++++- code/src/replicated-osd/replicated-osd.aer | 11 ++++++++--- code/src/replicated-osd/replicated-osd.haer | 2 ++ .../src/replicated-osd/tests/rosd-create-bench.aer | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) Diff of changes: diff --git a/code/src/kv/kv.aer b/code/src/kv/kv.aer index c3f7753..9f9c5a6 100644 --- a/code/src/kv/kv.aer +++ b/code/src/kv/kv.aer @@ -75,11 +75,16 @@ __blocking triton_ret_t triton_kv_put(triton_string_t *key, uint64_t value) req = malloc(sizeof(struct rosd_write_req)); memset(&req->buffer, 0, sizeof(req->buffer)); + req->oid = oid; + req->fork = 0; req->buffer.buffer = (char*)&value; req->buffer.size = sizeof(value); req->buffer.alloc_size = req->buffer.size; req->offset = 0; - req->flags = 0; + /* the ROSD_FLAG_TRUNC_WRITE flag will make the rosd_write() operation + * completely replace any data that was there previously + */ + req->flags = ROSD_FLAG_TRUNC_WRITE; ret = remote_rosd_write(rctx, addr, req, &out); if(ret != TRITON_SUCCESS) diff --git a/code/src/replicated-osd/replicated-osd.aer b/code/src/replicated-osd/replicated-osd.aer index 00ecded..c14a69f 100644 --- a/code/src/replicated-osd/replicated-osd.aer +++ b/code/src/replicated-osd/replicated-osd.aer @@ -223,7 +223,8 @@ __blocking triton_ret_t rosd_write_local_storage( uint64_t fork, uint64_t txn_number, triton_buffer_t buffer, - int64_t offset + int64_t offset, + uint32_t flags ) { triton_ret_t tret; @@ -231,13 +232,17 @@ __blocking triton_ret_t rosd_write_local_storage( int value = 0; char* buffer_offsets[1]; int64_t big_size = buffer.size; + int vosd_flags = VOSD_FLAG_AUTO_TXN; + + if(flags & ROSD_FLAG_TRUNC_WRITE) + vosd_flags |= VOSD_FLAG_TRUNC_WRITE; /* NOTE: a typical write is idempotent; no need for niid information * here */ buffer_offsets[0] = buffer.buffer; tret = vosd_write(oid, fork, txn_number, buffer_offsets, &big_size, - 1, &offset, &big_size, 1, VOSD_FLAG_AUTO_TXN, 0); + 1, &offset, &big_size, 1, vosd_flags, 0); if(tret != TRITON_SUCCESS) { triton_log_error(NULL, tret, "vosd_write()"); @@ -310,7 +315,7 @@ static __blocking triton_ret_t rosd_write_do_work( triton_debug(rosd_dbg_mask, "ROSD local write of oid %s on %d'th server.\n", oid_str, my_position); /* perform local operation */ local_tret = rosd_write_local_storage(oid, fork, txn_number, - buffer, offset); + buffer, offset, flags); } } diff --git a/code/src/replicated-osd/replicated-osd.haer b/code/src/replicated-osd/replicated-osd.haer index 4d7dd0b..2c1f24d 100644 --- a/code/src/replicated-osd/replicated-osd.haer +++ b/code/src/replicated-osd/replicated-osd.haer @@ -27,6 +27,8 @@ #define ROSD_FLAG_FANOUT 1 /* for requests that should be chained from the master for replication */ #define ROSD_FLAG_CHAIN 2 +/* to make writes automatically truncate any previous data in the object */ +#define ROSD_FLAG_TRUNC_WRITE 4 __remote struct rosd_create_req { diff --git a/code/src/replicated-osd/tests/rosd-create-bench.aer b/code/src/replicated-osd/tests/rosd-create-bench.aer index d2c468d..819d928 100644 --- a/code/src/replicated-osd/tests/rosd-create-bench.aer +++ b/code/src/replicated-osd/tests/rosd-create-bench.aer @@ -263,7 +263,7 @@ __blocking void do_remote_write(void) req.buffer.size = strlen(test_buffer) + 1; req.buffer.alloc_size = req.buffer.size; req.offset = 0; - req.flags = 0; + req.flags = ROSD_FLAG_TRUNC_WRITE; /* look up location of this object */ ret = triton_place_lookup(oid, 1, &svr_addr); hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov