Triton Repository branch, master, updated. 967ecd50221f0e1ae5febcc171c47c82a6761b41
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 967ecd50221f0e1ae5febcc171c47c82a6761b41 (commit) via 7b8cd8863ea6cb92170306cf0415ab44044cbc1a (commit) via f84cf30a9c0c8027cf127f63226b0ddd05a7a31f (commit) from 26c361acf3465184e4405c3ea7fec2c0cf3dba16 (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 967ecd50221f0e1ae5febcc171c47c82a6761b41 Author: Justin Wozniak <[email protected]> Date: Mon Jun 6 14:53:50 2011 -0500 Now vosd_enumerate() just calls vosd_range(). New triton_uint128_setmax() commit 7b8cd8863ea6cb92170306cf0415ab44044cbc1a Author: Justin Wozniak <[email protected]> Date: Mon Jun 6 14:16:10 2011 -0500 New vosd_range() and test (2) commit f84cf30a9c0c8027cf127f63226b0ddd05a7a31f Author: Justin Wozniak <[email protected]> Date: Mon Jun 6 14:15:42 2011 -0500 New vosd_range() and test ----------------------------------------------------------------------- Summary of changes: code/src/common/triton-uint128.h | 1 + .../src/versioned-osd/prototype/tests/module.mk.in | 1 + .../prototype/tests/vosd-enumerate.ae | 15 ++++-- .../tests/{vosd-enumerate.ae => vosd-range.ae} | 51 +++++++++++++++----- code/src/versioned-osd/prototype/versioned-osd.ae | 39 +++++++++------ code/src/versioned-osd/prototype/versioned-osd.hae | 13 +++++- 6 files changed, 87 insertions(+), 33 deletions(-) copy code/src/versioned-osd/prototype/tests/{vosd-enumerate.ae => vosd-range.ae} (68%) Diff of changes: diff --git a/code/src/common/triton-uint128.h b/code/src/common/triton-uint128.h index 7761cc2..64e4942 100644 --- a/code/src/common/triton-uint128.h +++ b/code/src/common/triton-uint128.h @@ -11,6 +11,7 @@ typedef struct { uint64_t l; uint64_t u; } uint128_t; #define triton_uint128_setzero(t) t.l = 0, t.u = 0 #define triton_uint128_iszero(t) (t.l == 0 && t.u == 0) +#define triton_uint128_setmax(t) t.l = UINT64_MAX, t.u = UINT64_MAX #define triton_uint128_set(from, to) ((to).l = (from).l, (to).u = (from).u) diff --git a/code/src/versioned-osd/prototype/tests/module.mk.in b/code/src/versioned-osd/prototype/tests/module.mk.in index afa68df..3b6d38e 100644 --- a/code/src/versioned-osd/prototype/tests/module.mk.in +++ b/code/src/versioned-osd/prototype/tests/module.mk.in @@ -3,6 +3,7 @@ DIR := src/versioned-osd/prototype/tests AETESTSRC += $(DIR)/vosd1.ae AETESTSRC += $(DIR)/vosd-dump.ae AETESTSRC += $(DIR)/vosd-enumerate.ae +AETESTSRC += $(DIR)/vosd-range.ae AETESTSRC += $(DIR)/vosd-autotune.ae AETESTSRC += $(DIR)/vosd-niid.ae AETESTSRC += $(DIR)/fake1.ae diff --git a/code/src/versioned-osd/prototype/tests/vosd-enumerate.ae b/code/src/versioned-osd/prototype/tests/vosd-enumerate.ae index b9390ea..bef00d3 100644 --- a/code/src/versioned-osd/prototype/tests/vosd-enumerate.ae +++ b/code/src/versioned-osd/prototype/tests/vosd-enumerate.ae @@ -26,17 +26,24 @@ static __blocking int do_vosd_test(void) triton_ret_t tret; int i; char oid_str[TRITON_UINT128_STRLEN]; + int result; oids = malloc(count * sizeof(uint128_t)); - tret = vosd_enumerate(count, offset, oids); + tret = vosd_enumerate(count, offset, oids, &result); if(tret != TRITON_SUCCESS) { - printf("Error dumping VOSD state.\n"); + printf("Error in vosd_enumerate()\n"); triton_error_destroy(tret); return(1); } - for (i = 0; i < count; i++) + if (result < count) + { + printf("vosd-enumerate: warning: " + "requested %i oids but received %i\n", count, result); + } + + for (i = 0; i < result; i++) { triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oids[i]); @@ -57,7 +64,7 @@ int main(int argc, char *argv[]) if(argc != 5) { - fprintf(stderr, "Usage: vosd-dump <vosd path> <vosd log path>" + fprintf(stderr, "Usage: vosd-dump <vosd path> <vosd log path> " "<count> <offset>\n"); return(-1); } diff --git a/code/src/versioned-osd/prototype/tests/vosd-enumerate.ae b/code/src/versioned-osd/prototype/tests/vosd-range.ae similarity index 68% copy from code/src/versioned-osd/prototype/tests/vosd-enumerate.ae copy to code/src/versioned-osd/prototype/tests/vosd-range.ae index b9390ea..d8aff4a 100644 --- a/code/src/versioned-osd/prototype/tests/vosd-enumerate.ae +++ b/code/src/versioned-osd/prototype/tests/vosd-range.ae @@ -13,6 +13,8 @@ static int do_vosd_test_ret; int count; int offset; +uint128_t lower; +uint128_t upper; uint128_t *oids; static void done_callback(void *up, int ret) @@ -26,17 +28,18 @@ static __blocking int do_vosd_test(void) triton_ret_t tret; int i; char oid_str[TRITON_UINT128_STRLEN]; + int result; oids = malloc(count * sizeof(uint128_t)); - tret = vosd_enumerate(count, offset, oids); + tret = vosd_range(count, offset, lower, upper, oids, &result); if(tret != TRITON_SUCCESS) { - printf("Error dumping VOSD state.\n"); + printf("Error in vosd_enumerate()\n"); triton_error_destroy(tret); return(1); } - for (i = 0; i < count; i++) + for (i = 0; i < result; i++) { triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oids[i]); @@ -46,6 +49,8 @@ static __blocking int do_vosd_test(void) return 1; } +#define LLU long long unsigned int * + int main(int argc, char *argv[]) { triton_ret_t ret; @@ -54,32 +59,52 @@ int main(int argc, char *argv[]) int pc = 0; ae_op_id_t op_id; int c; + /** arg index */ + int arg_i = 1; - if(argc != 5) + if(argc != 7) { - fprintf(stderr, "Usage: vosd-dump <vosd path> <vosd log path>" - "<count> <offset>\n"); + fprintf(stderr, "Usage: vosd-dump <vosd path> <vosd log path> " + "<count> <offset> <lower> <upper>\n"); return(-1); } - ret = triton_zeroconf_set("triton.vosd.db_path", argv[1]); + ret = triton_zeroconf_set("triton.vosd.db_path", argv[arg_i++]); triton_error_assert(ret); - ret = triton_zeroconf_set("triton.vosd.data_path", argv[2]); + ret = triton_zeroconf_set("triton.vosd.data_path", argv[arg_i++]); triton_error_assert(ret); - c = sscanf(argv[3], "%i", &count); + c = sscanf(argv[arg_i], "%i", &count); if(c != 1) { - fprintf(stderr, "could not scan <count>: %s\n", argv[3]); + fprintf(stderr, "could not scan <count>: %s\n", argv[arg_i]); return(-1); } + arg_i++; - c = sscanf(argv[4], "%i", &offset); + c = sscanf(argv[arg_i], "%i", &offset); if(c != 1) { - fprintf(stderr, "could not scan <offset>: %s\n", argv[4]); + fprintf(stderr, "could not scan <offset>: %s\n", argv[arg_i]); + return(-1); + } + arg_i++; + + c = sscanf(argv[arg_i], "%llu:%llu", (LLU) &lower.u, (LLU) &lower.l); + if(c != 2) + { + fprintf(stderr, "could not scan <lower>: %s\n", argv[arg_i]); return(-1); } + arg_i++; + + c = sscanf(argv[arg_i], "%llu:%llu", (LLU) &upper.u, (LLU) &upper.l); + if(c != 2) + { + fprintf(stderr, "could not scan <upper.l>: %s\n", argv[arg_i]); + return(-1); + } + arg_i++; /* test initializing a specific component */ ret = triton_init("triton.vosd"); @@ -122,6 +147,8 @@ int main(int argc, char *argv[]) triton_finalize(); + puts("OK"); + return do_vosd_test_ret; } diff --git a/code/src/versioned-osd/prototype/versioned-osd.ae b/code/src/versioned-osd/prototype/versioned-osd.ae index 5dc013f..e621652 100644 --- a/code/src/versioned-osd/prototype/versioned-osd.ae +++ b/code/src/versioned-osd/prototype/versioned-osd.ae @@ -2115,8 +2115,6 @@ __blocking triton_ret_t vosd_dump(void) triton_error_destroy(tret); /* search for logical map entries */ - printf(" logical map:\n"); - printf(" ------------------------------------------\n"); lmk.oid = vk; lmk.oid_fork = 0; lmk.logical_offset_end = 0; @@ -2203,9 +2201,25 @@ __blocking triton_ret_t vosd_dump(void) return(TRITON_SUCCESS); } +static const int error_count_max = 8; __blocking triton_ret_t vosd_enumerate(int count, int offset, - uint128_t *oids) + uint128_t *oids, + int *result) +{ + uint128_t lower; + uint128_t upper; + triton_uint128_setzero(lower); + triton_uint128_setmax(upper); + return vosd_range(count, offset, lower, upper, oids, result); +} + +__blocking triton_ret_t vosd_range(int count, + int offset, + uint128_t lower, + uint128_t upper, + uint128_t *oids, + int *result) { triton_ret_t tret; triton_ret_t tret_tmp; @@ -2246,7 +2260,6 @@ __blocking triton_ret_t vosd_enumerate(int count, * state. This caveat allows us to simply print contents as they are * encountered without maintaining any state. */ - printf("Dumping VOSD contents...\n"); tret = throttle_bdb_txn_begin(envp, NULL, &txn, 0); if(tret != TRITON_SUCCESS) { @@ -2294,6 +2307,9 @@ __blocking triton_ret_t vosd_enumerate(int count, pointer = 0; while (tret == TRITON_SUCCESS) { + if (triton_cmp_uint128(vk, lower) == -1 || + triton_cmp_uint128(vk, upper) == 1) + goto next; if (current < offset) goto skip; if (pointer >= count) @@ -2304,12 +2320,8 @@ __blocking triton_ret_t vosd_enumerate(int count, pointer++; triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, vk); - printf("OID: %s\n", oid_str); - printf("=============================================\n"); - printf(" version: %llu\n", llu(vv)); /* search for any missing versions */ - printf(" missing versions: "); mvk.oid = vk; mvk.version = 0; c_get_flag = DB_SET_RANGE; @@ -2318,11 +2330,9 @@ __blocking triton_ret_t vosd_enumerate(int count, while(tret == TRITON_SUCCESS) { c_get_flag = DB_NEXT; - printf("%llu ", llu(mvk.version)); tret = bdb_cursor_get(missing_ver_dbcp, &missing_ver_key, &missing_ver_value, c_get_flag); } - printf("\n"); if(tret != TRITON_ERR_NOENT) { printf(" *** INCOMPLETE: error getting missing versions.\n"); @@ -2339,8 +2349,6 @@ __blocking triton_ret_t vosd_enumerate(int count, triton_error_destroy(tret); /* search for logical map entries */ - printf(" logical map:\n"); - printf(" ------------------------------------------\n"); lmk.oid = vk; lmk.oid_fork = 0; lmk.logical_offset_end = 0; @@ -2373,8 +2381,9 @@ __blocking triton_ret_t vosd_enumerate(int count, triton_error_destroy(tret); skip: - tret = bdb_cursor_get(ver_dbcp, &ver_key, &ver_value, DB_NEXT); current++; + next: + tret = bdb_cursor_get(ver_dbcp, &ver_key, &ver_value, DB_NEXT); } if (tret != TRITON_SUCCESS) @@ -2388,8 +2397,6 @@ __blocking triton_ret_t vosd_enumerate(int count, triton_error_destroy(tret); /* dump niid database all at once*/ - printf("NIIDs:\n"); - printf("=============================================\n"); tret = bdb_cursor(niid_dbp, txn, &niid_dbcp, 0); if(tret != TRITON_SUCCESS) { @@ -2409,12 +2416,12 @@ __blocking triton_ret_t vosd_enumerate(int count, llu(nkey.niid), nkey.op_type, lld(nvalue.timestamp)); tret = bdb_cursor_get(niid_dbcp, &nd_key, &nd_value, DB_NEXT); } - printf("\n"); tret = bdb_cursor_close(niid_dbcp); tret = throttle_bdb_txn_commit(txn, 0); triton_error_destroy(tret); + *result = pointer; return(TRITON_SUCCESS); } diff --git a/code/src/versioned-osd/prototype/versioned-osd.hae b/code/src/versioned-osd/prototype/versioned-osd.hae index 55de632..e468cb7 100644 --- a/code/src/versioned-osd/prototype/versioned-osd.hae +++ b/code/src/versioned-osd/prototype/versioned-osd.hae @@ -69,7 +69,18 @@ __blocking triton_ret_t vosd_dump(void); */ __blocking triton_ret_t vosd_enumerate(int offset, int count, - uint128_t *oids); + uint128_t *oids, + int *result); +/** + * Obtain a list of all OIDs between lower and upper, inclusive + * NOTE: the VOSD must be quiescent during this operation + */ +__blocking triton_ret_t vosd_range(int count, + int offset, + uint128_t lower, + uint128_t upper, + uint128_t *oids, + int *result); /** * Opens a txn hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov