branch, master, updated. 23442d64b3c80ec399436319dc7a44cd42b1011f
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 23442d64b3c80ec399436319dc7a44cd42b1011f (commit) from f5ed0eb7854e90129b46562f4557d163cf9d86c9 (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 23442d64b3c80ec399436319dc7a44cd42b1011f Author: John Jenkins <[email protected]> Date: Thu Sep 25 13:57:39 2014 -0500 probe_object fix for default rep factor + test (trac #319) ----------------------------------------------------------------------- Summary of changes: code/src/replicated-osd/rosd-create.ae | 46 +++++++++----------- code/src/transactional-osd/transactional-osd.ae | 2 +- code/tests/Makefile.subdir | 1 + code/tests/triton-ls-object.sh | 52 +++++++++++++++++++++++ 4 files changed, 75 insertions(+), 26 deletions(-) create mode 100755 code/tests/triton-ls-object.sh Diff of changes: diff --git a/code/src/replicated-osd/rosd-create.ae b/code/src/replicated-osd/rosd-create.ae index e0638b5..442158a 100644 --- a/code/src/replicated-osd/rosd-create.ae +++ b/code/src/replicated-osd/rosd-create.ae @@ -286,35 +286,31 @@ static __blocking triton_ret_t rosd_create_local_storage( return triton_error_wrap(tret, self, "tosd_create failed"); } - if(replication_factor != rosd_default_replication_factor) + /* store replication factor directly in a data fork */ + obj_offset = 0; + buffer_offsets[0] = (char*)&replication_factor; + size = sizeof(replication_factor); + + /* NOTE: no need for tracking NIID for this portion of the operation. + * There is no harm in writing the replication factor twice. We do need + * to look out for conflicts on the transaction number, though. + */ + tret = tosd_write(oid, REP_FACTOR_FORK, 1, buffer_offsets, + &size, 1, &obj_offset, &size, 1, TOSD_FLAG_AUTO_TXN, 0, NULL); + if(tret != TRITON_SUCCESS) { - - /* store replication factor directly in a data fork */ - obj_offset = 0; - buffer_offsets[0] = (char*)&replication_factor; - size = sizeof(replication_factor); - - /* NOTE: no need for tracking NIID for this portion of the operation. - * There is no harm in writing the replication factor twice. We do need - * to look out for conflicts on the transaction number, though. + /* We created the object but weren't able to write its metadata. + * Give a best effort here to remove the object in order to simplify + * cleanup later. It's ok if this does not succeed. */ - tret = tosd_write(oid, REP_FACTOR_FORK, 1, buffer_offsets, - &size, 1, &obj_offset, &size, 1, TOSD_FLAG_AUTO_TXN, 0, NULL); - if(tret != TRITON_SUCCESS) + tret_tmp = tosd_remove(oid, 0); + if(tret_tmp != TRITON_SUCCESS) { - /* We created the object but weren't able to write its metadata. - * Give a best effort here to remove the object in order to simplify - * cleanup later. It's ok if this does not succeed. - */ - tret_tmp = tosd_remove(oid, 0); - if(tret_tmp != TRITON_SUCCESS) - { - triton_error_destroy(tret_tmp); - } - /* don't propagate tret_tmp to the caller; we want the caller to see - * the original error code instead, not side-effects from cleanup. - */ + triton_error_destroy(tret_tmp); } + /* don't propagate tret_tmp to the caller; we want the caller to see + * the original error code instead, not side-effects from cleanup. + */ } return(tret); diff --git a/code/src/transactional-osd/transactional-osd.ae b/code/src/transactional-osd/transactional-osd.ae index cefefdc..329be2c 100644 --- a/code/src/transactional-osd/transactional-osd.ae +++ b/code/src/transactional-osd/transactional-osd.ae @@ -4771,5 +4771,5 @@ __blocking triton_ret_t tosd_reset (uint128_t oid, * c-basic-offset: 4 * End: * - * vim: ts=8 sts=4 sw=4 expandtab + * vim: ft=c ts=8 sts=4 sw=4 expandtab */ diff --git a/code/tests/Makefile.subdir b/code/tests/Makefile.subdir index d75b6c2..4212fc6 100644 --- a/code/tests/Makefile.subdir +++ b/code/tests/Makefile.subdir @@ -28,6 +28,7 @@ TESTS += \ tests/triton-cp-big.sh \ tests/triton-ls.sh \ tests/triton-rm.sh \ + tests/triton-ls-object.sh \ tests/triton-show-system-state.sh \ tests/triton-show-config.sh \ tests/triton-show-debug-masks.sh \ diff --git a/code/tests/triton-ls-object.sh b/code/tests/triton-ls-object.sh new file mode 100755 index 0000000..03ce5e3 --- /dev/null +++ b/code/tests/triton-ls-object.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +if [ -z $srcdir ]; then + echo srcdir variable not set. + exit 1 +fi +source $srcdir/tests/test-util.sh + +function tear_down () { + run_to 60 src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null + rm -r \ + ${TMPBASE}/triton-server-*-data \ + ${TMPBASE}/triton-server-*-meta \ + ${TMPBASE}/triton-server-*.log +} + +num_servers=4 + +# start 4 servers with 15 second wait, 60s timeout +test_start_servers $num_servers 15 75 + +for ns in $(seq 1 $num_servers) ; do + run_to 60 src/admin-tools/triton-mkdat -r $ns -w 4 -s 2 $svr1 + if [[ $? -ne 0 ]] ; then + echo triton-mkdat unsuccessful >&2 ; tear_down ; wait ; exit 1 + fi + # test: run ls on the object, grab the fork/count/size + _tmp=($(run_to 60 src/admin-tools/triton-ls $svr1/::1 \ + | tail -n +2 | awk '{print $2;}')) + if [[ $? -ne 0 ]] ; then + echo triton-ls unsuccessful >&2 ; tear_down ; wait ; exit 1 + fi + # check output + if [[ ${_tmp[0]} != "::1" || ${_tmp[1]} -ne 4 || ${_tmp[2]} -ne 8 ]] ; then + echo "bad ls output (expected fork ::1, 4 records, size 8, got " \ + "${_tmp[0]}, ${_tmp[1]}, ${_tmp[2]}" >&2 + tear_down + wait ; exit 1 + fi + + # remove the data for the next iteration + run_to 60 src/admin-tools/triton-rm --server $svr1 ::1 + if [[ $? -ne 0 ]] ; then + echo unable to rm data >&2 ; tear_down ; wait ; exit 1 + fi +done + +# tear down +run_to 60 src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null + +wait +exit 0 hooks/post-receive --
participants (1)
-
noreply@mcs.anl.gov