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 128a736ad62a003759027ce7fdfedefb55f6d77f (commit)
via c421a9fdfbb21543740d39c1b080fbcc3e2a9114 (commit)
via 6be7b1c5520c230b612b750310143918e91cbc31 (commit)
from 591fb2a9b70847edc5e959bd609261a918847e52 (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 128a736ad62a003759027ce7fdfedefb55f6d77f
Author: Kevin Harms <harms(a)alcf.anl.gov>
Date: Mon Nov 25 14:42:28 2013 -0600
update rosd routines for new triton_uint128_to_string method
commit c421a9fdfbb21543740d39c1b080fbcc3e2a9114
Merge: 6be7b1c5520c230b612b750310143918e91cbc31 591fb2a9b70847edc5e959bd609261a918847e52
Author: Kevin Harms <harms(a)alcf.anl.gov>
Date: Mon Nov 25 13:44:15 2013 -0600
Merge branch 'master' of git.mcs.anl.gov:triton
commit 6be7b1c5520c230b612b750310143918e91cbc31
Author: Kevin Harms <harms(a)alcf.anl.gov>
Date: Mon Nov 25 13:43:59 2013 -0600
ipv6 formatting for oids in strings
-----------------------------------------------------------------------
Summary of changes:
code/scripts/launch_servers.sh | 2 +-
code/src/admin-tools/triton-ls.ae | 6 ++--
code/src/admin-tools/triton-rm.ae | 32 +++++++------------
code/src/common/node.c | 36 -----------------------
code/src/common/node.h | 5 +--
code/src/replicated-osd/rosd-create.ae | 13 +++++---
code/src/replicated-osd/rosd-remove.ae | 18 +++++++----
code/src/replicated-osd/rosd-txn-nr-cache.ae | 19 ++++++------
code/src/replicated-osd/rosd-write.ae | 8 +++--
code/src/replicated-osd/rosd.ae | 5 ++-
code/src/system-state/system-state.ae | 6 ++--
code/src/transactional-osd/tosd-fd-cache.ae | 24 ++++++++-------
code/src/transactional-osd/transactional-osd.ae | 8 +++--
code/tests/placement/test-placement.c | 29 ++++++++++++------
code/tests/system-state/test-system-state.ae | 2 +-
code/tests/test-util.sh | 2 +-
code/tests/triton-rm.sh | 10 +++---
code/tests/triton-start-test-servers.sh | 2 +-
code/tests/triton-touch.sh | 2 +-
19 files changed, 104 insertions(+), 125 deletions(-)
Diff of changes:
diff --git a/code/scripts/launch_servers.sh b/code/scripts/launch_servers.sh
index 65a484e..553fe93 100755
--- a/code/scripts/launch_servers.sh
+++ b/code/scripts/launch_servers.sh
@@ -56,7 +56,7 @@ echo -n > $HOSTFILE
endport=$(($g_baseport + $g_nservers - 1))
for p in $(seq $g_baseport $endport)
do
- echo -e "$p.0\t${LADDR}:$p" >> $HOSTFILE
+ echo -e "$p::0\t${LADDR}:$p" >> $HOSTFILE
done
# create screen commands
diff --git a/code/src/admin-tools/triton-ls.ae b/code/src/admin-tools/triton-ls.ae
index df69ea4..4e2273d 100644
--- a/code/src/admin-tools/triton-ls.ae
+++ b/code/src/admin-tools/triton-ls.ae
@@ -30,7 +30,7 @@ __blocking int aesop_main(int argc, char **argv)
uint128_t upper;
uint128_t *oid_array;
uint32_t oid_array_count;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
if(argc != 2)
{
@@ -126,9 +126,9 @@ __blocking int aesop_main(int argc, char **argv)
&next_position);
for(j=0; !triton_is_error(tret) && j<oid_array_count; j++)
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN,
- oid_array[j]);
+ oid_str = triton_uint128_to_string(oid_array[j]);
printf("\t%s\n", oid_str);
+ if (oid_str) free(oid_str);
}
lower = next_position;
}
diff --git a/code/src/admin-tools/triton-rm.ae b/code/src/admin-tools/triton-rm.ae
index d65ca92..2883eb9 100644
--- a/code/src/admin-tools/triton-rm.ae
+++ b/code/src/admin-tools/triton-rm.ae
@@ -91,23 +91,14 @@ void parse_args (int *argc,
for (i=optind; i < *argc; i++)
{
- uint64_t u;
- uint64_t l;
- int n;
-
- n = sscanf((*argv)[i], "%" SCNu64 ".%" SCNu64, &u, &l);
- if (n == 2)
- {
- (*oids)[*oid_count].u = u;
- (*oids)[*oid_count].l = l;
- *oid_count += 1;
- }
- else
- {
- if (*verbose) {
- fprintf(stderr, "invalid oid: %s\n", (*argv)[i]);
- }
- }
+ uint128_t oid;
+
+ oid = triton_uint128_from_string((*argv)[i]);
+ triton_uint128_set(oid, (*oids)[*oid_count]);
+ *oid_count += 1;
+ //if (*verbose) {
+ // fprintf(stderr, "invalid oid: %s\n", (*argv)[i]);
+ //}
}
}
@@ -173,9 +164,10 @@ __blocking int aesop_main(int argc, char **argv)
{
if (verbose)
{
- char oidstr[TRITON_UINT128_STRLEN];
- triton_uint128_to_string(oidstr, sizeof(oidstr), oids[i]);
- printf("removing: %s\n", oidstr);
+ char *oid_str;
+ oid_str = triton_uint128_to_string(oids[i]);
+ printf("removing: %s\n", oid_str);
+ if (oid_str) free(oid_str);
}
tret = remote_triton_rpc_rosd_remove (oids[i], ROSD_FLAG_CHAIN);
if (triton_is_error(tret))
diff --git a/code/src/common/node.c b/code/src/common/node.c
index b757613..b71aaf3 100644
--- a/code/src/common/node.c
+++ b/code/src/common/node.c
@@ -25,42 +25,6 @@ int triton_cmp_node(triton_node_t a, triton_node_t b)
return 0;
}
-char* triton_node_to_string(triton_node_t node)
-{
- char* tmp = malloc(34);
- if(!tmp)
- {
- return(NULL);
- }
- sprintf(tmp, "%016llu.%016llu", llu(node.u), llu(node.l));
- return(tmp);
-}
-
-triton_node_t triton_node_from_string(const char *s)
-{
- int n;
-#if SIZEOF_LONG_INT == 4
- uint64_t u;
- uint64_t l;
-#elif SIZEOF_LONG_INT == 8
- long long unsigned int u;
- long long unsigned int l;
-#else
-# error Unexpected sizeof(long int)
-#endif
-
- triton_node_t node = triton_node_null;
-
- n = sscanf(s, "%llu.%llu", &u, &l);
- if (n != 2)
- return triton_node_null;
-
- node.u = (uint64_t) u;
- node.l = (uint64_t) l;
-
- return(node);
-}
-
/*
* Local Variables:
* c-basic-offset: 4
diff --git a/code/src/common/node.h b/code/src/common/node.h
index e9fdb7e..e1e492d 100644
--- a/code/src/common/node.h
+++ b/code/src/common/node.h
@@ -10,9 +10,8 @@ extern const triton_node_t triton_node_null;
#define triton_node_equal(a,b) (triton_cmp_uint128(a,b)==0)
-char* triton_node_to_string(triton_node_t node);
-
-triton_node_t triton_node_from_string(const char *s);
+#define triton_node_to_string(a) triton_uint128_to_string(a)
+#define triton_node_from_string(a) (triton_node_t)triton_uint128_from_string(a)
int triton_cmp_node(triton_node_t a, triton_node_t b);
diff --git a/code/src/replicated-osd/rosd-create.ae b/code/src/replicated-osd/rosd-create.ae
index 918018d..e8aab64 100644
--- a/code/src/replicated-osd/rosd-create.ae
+++ b/code/src/replicated-osd/rosd-create.ae
@@ -42,7 +42,7 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
triton_rpc_rosd_create_out_t out;
triton_rpc_rosd_create_in_t in;
int ret = 0;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
int my_position;
na_addr_t *addr_array = NULL;
int got_addrs = 0;
@@ -53,10 +53,11 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
triton_mercury_get_input(handle, &in, &out);
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, in.oid);
+ oid_str = triton_uint128_to_string(in.oid);
triton_debug(triton_dbg_rosd, "triton_rpc_rosd_create() params: oid: %s, flags: %d, replication_factor: %d, niid: %llu\n",
oid_str, in.flags, in.replication_factor, llu(in.niid));
+ if (oid_str) free(oid_str);
out.tret = TRITON_SUCCESS;
@@ -187,15 +188,16 @@ static __blocking triton_ret_t rosd_create_do_work(
/* forward request while simultaneously performing local work */
pwait
{
- pprivate char oid_str[TRITON_UINT128_STRLEN];
+ pprivate char* oid_str;
pbranch
{
if(my_position < replication_factor -1)
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd,
"ROSD forwarding create of oid %s to %d'th server.\n",
oid_str, my_position+1);
+ if (oid_str) free(oid_str);
remote_tret = __remote_triton_rpc_rosd_create(next_addr, oid,
replication_factor,
@@ -204,8 +206,9 @@ static __blocking triton_ret_t rosd_create_do_work(
}
pbranch
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd, "ROSD local create of oid %s on %d'th server.\n", oid_str, my_position);
+ if (oid_str) free(oid_str);
/* perform local operation */
local_tret = rosd_create_local_storage(oid, replication_factor, niid);
}
diff --git a/code/src/replicated-osd/rosd-remove.ae b/code/src/replicated-osd/rosd-remove.ae
index 163e752..45b10d6 100644
--- a/code/src/replicated-osd/rosd-remove.ae
+++ b/code/src/replicated-osd/rosd-remove.ae
@@ -90,7 +90,7 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
int i;
na_addr_t *addr_array;
na_addr_t next_addr;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
triton_ret_t tret;
uint32_t replication_factor;
@@ -108,7 +108,7 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
triton_mercury_get_input(handle, &in, &out);
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, in.oid);
+ oid_str = triton_uint128_to_string(in.oid);
triton_debug(triton_dbg_rosd,
"triton_rpc_rosd_remove() params: oid: %s, flags: %d, replication_factor: %d, niid: %llu, position:%d\n",
oid_str,
@@ -116,6 +116,7 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
in.replication_factor,
llu(in.niid),
in.expected_position);
+ if (oid_str) free(oid_str);
/*
* A replication factor of zero indicates this is the initial client
@@ -244,14 +245,15 @@ static __blocking triton_ret_t rosd_remove_do_work(
pwait
{
- pprivate char oid_str[TRITON_UINT128_STRLEN];
+ pprivate char *oid_str;
pbranch
{
/* forward on to peers if necessary */
if(my_position < replication_factor-1)
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd, "ROSD forwarding remove of oid %s to %d'th server.\n", oid_str, my_position+1);
+ if (oid_str) free(oid_str);
remote_tret = __remote_triton_rpc_rosd_remove(
next_addr,
@@ -263,8 +265,9 @@ static __blocking triton_ret_t rosd_remove_do_work(
}
pbranch
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd, "ROSD local remove of oid %s on %d'th server.\n", oid_str, my_position);
+ if (oid_str) free(oid_str);
/* perform local operation */
local_tret = rosd_remove_local_storage(oid, niid);
}
@@ -322,7 +325,7 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_remove(
int ret;
triton_ret_t tret;
int position;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
in.oid = oid;
in.flags = flags;
@@ -330,8 +333,9 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_remove(
in.niid = 0; /* TODO: generate real NIIDs */
in.expected_position = expected_position;
- triton_uint128_to_string(oid_str, sizeof(oid_str), in.oid);
+ oid_str = triton_uint128_to_string(in.oid);
triton_debug(triton_dbg_rosd, "__remote_triton_rpc_rosd_remove: post: oid=%s flags=%d rf=%d niid=%lld pos=%d\n", oid_str, in.flags, in.replication_factor, lld(in.niid), in.expected_position);
+ if (oid_str) free(oid_str);
ret = HG_Forward(addr,
rpc_rosd_remove_id,
diff --git a/code/src/replicated-osd/rosd-txn-nr-cache.ae b/code/src/replicated-osd/rosd-txn-nr-cache.ae
index 1210dcb..88be691 100644
--- a/code/src/replicated-osd/rosd-txn-nr-cache.ae
+++ b/code/src/replicated-osd/rosd-txn-nr-cache.ae
@@ -83,7 +83,7 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
struct triton_list_link* scratch;
triton_ret_t tret;
triton_ret_t tret_tmp;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
triton_mutex_lock(&txn_nr_mutex);
assert(oid_table);
@@ -112,10 +112,11 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
tmp_entry->txn_number++;
*next_txn_number = tmp_entry->txn_number;
}
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd_txncache,
"returning cached entry for oid %s: txn_number: %llu\n", oid_str,
llu(*next_txn_number));
+ if(oid_str) free(oid_str);
}
else
{
@@ -188,10 +189,11 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
if(!(flags & ROSD_FLAG_COND_WRITE))
*next_txn_number = tmp_entry->txn_number;
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd_txncache,
"generating new cache entry for oid %s: txn_number: %llu\n", oid_str,
llu(*next_txn_number));
+ if (oid_str) free(oid_str);
}
@@ -202,10 +204,10 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
{
dead_entry = triton_list_get_entry(iterator, struct txn_nr_cache_entry,
lru_link);
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN,
- dead_entry->oid);
+ oid_str = triton_uint128_to_string(dead_entry->oid);
triton_debug(triton_dbg_rosd_txncache,
"removing stale oid %s from cache\n", oid_str);
+ if(oid_str) free(oid_str);
triton_list_del(&dead_entry->lru_link);
triton_list_del(&dead_entry->hash_link);
txn_nr_cache_destructor(dead_entry); /* decrements hash count too */
@@ -224,15 +226,14 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
void txn_nr_cache_put(struct txn_nr_cache_entry* entry)
{
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
triton_mutex_lock(&txn_nr_mutex);
assert(oid_table);
entry->ref_count--;
assert(entry->ref_count >= 0);
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN,
- entry->oid);
+ oid_str = triton_uint128_to_string(entry->oid);
/* if ref count hits zero, then add to lru list as a candidate to be
* dropped from the cache later
@@ -249,7 +250,7 @@ void txn_nr_cache_put(struct txn_nr_cache_entry* entry)
triton_debug(triton_dbg_rosd_txncache,
"putting oid %s from cache, still active\n", oid_str);
}
-
+ if (oid_str) free(oid_str);
triton_mutex_unlock(&txn_nr_mutex);
return;
}
diff --git a/code/src/replicated-osd/rosd-write.ae b/code/src/replicated-osd/rosd-write.ae
index 1ab6183..aba4f61 100644
--- a/code/src/replicated-osd/rosd-write.ae
+++ b/code/src/replicated-osd/rosd-write.ae
@@ -498,14 +498,15 @@ static __blocking triton_ret_t rosd_write_do_work(
/* TODO: implement conditionals */
pwait
{
- pprivate char oid_str[TRITON_UINT128_STRLEN];
+ pprivate char* oid_str;
pbranch
{
/* forward on to peers if necessary */
if(my_position < replication_factor-1)
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd, "ROSD forwarding write of oid %s to %d'th server.\n", oid_str, my_position+1);
+ if (oid_str) free(oid_str);
remote_tret = __remote_triton_rpc_rosd_write(
next_addr, oid, oid_fork, buffer, size, offset, flags, replication_factor,
@@ -514,8 +515,9 @@ static __blocking triton_ret_t rosd_write_do_work(
}
pbranch
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd, "ROSD local write of oid %s on %d'th server, transaction number %llu.\n", oid_str, my_position, llu(txn_number));
+ if (oid_str) free(oid_str);
/* perform local operation */
local_tret = rosd_write_local_storage(oid, oid_fork, txn_number,
buffer, size, offset, flags);
diff --git a/code/src/replicated-osd/rosd.ae b/code/src/replicated-osd/rosd.ae
index eed96d2..fa72023 100644
--- a/code/src/replicated-osd/rosd.ae
+++ b/code/src/replicated-osd/rosd.ae
@@ -80,7 +80,7 @@ triton_ret_t triton_oid_to_addrs(uint128_t oid, uint32_t replication_factor, int
triton_node_t* target_nodes;
int i;
triton_node_t self;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
*my_position = -1;
@@ -112,7 +112,7 @@ triton_ret_t triton_oid_to_addrs(uint128_t oid, uint32_t replication_factor, int
return(tret);
}
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
for(i=0; i<replication_factor; i++)
{
@@ -141,6 +141,7 @@ triton_ret_t triton_oid_to_addrs(uint128_t oid, uint32_t replication_factor, int
free(svr_string);
}
+ if (oid_str) free(oid_str);
free(target_nodes);
free(node_array);
diff --git a/code/src/system-state/system-state.ae b/code/src/system-state/system-state.ae
index 5d0fd03..9929fd3 100644
--- a/code/src/system-state/system-state.ae
+++ b/code/src/system-state/system-state.ae
@@ -165,9 +165,9 @@ char* system_state_serialize(void)
{
size +=
strlen(entry->value) +
- 33 + /* this is the string length of a node */
+ INET6_ADDRSTRLEN + /* this is the string length of a node */
strlen(key_array[i].key) +
- 8; /* delimiters */
+ 8; /* delimiters */
}
}
@@ -199,7 +199,7 @@ char* system_state_serialize(void)
node_str = triton_node_to_string(entry->node);
ret = sprintf(&tmp[position], "<%s><%s><%s>", node_str,
key_array[i].key, entry->value);
- free(node_str);
+ if (node_str) free(node_str);
position += ret;
}
}
diff --git a/code/src/transactional-osd/tosd-fd-cache.ae b/code/src/transactional-osd/tosd-fd-cache.ae
index 25eafda..cfda491 100644
--- a/code/src/transactional-osd/tosd-fd-cache.ae
+++ b/code/src/transactional-osd/tosd-fd-cache.ae
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 600
+#define _GNU_SOURCE
#include <unistd.h>
#include <sys/types.h>
@@ -38,7 +38,7 @@ static __blocking void fd_cache_purge_internal(int watermark)
struct fd_cache_entry* dead_entry;
int ret;
struct stat statbuf;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
triton_list_t purge_list;
triton_list_init(&purge_list);
@@ -84,11 +84,11 @@ static __blocking void fd_cache_purge_internal(int watermark)
ret = aefile_ftruncate(dead_entry->fd, dead_entry->log_offset);
if(ret != 0)
{
- triton_uint128_to_string(oid_str,
- TRITON_UINT128_STRLEN, dead_entry->oid);
+ oid_str = triton_uint128_to_string(dead_entry->oid);
triton_error_msg(
"Failed to truncate object %s, continuing.\n",
oid_str);
+ if (oid_str) free(oid_str);
/* will show up as an error at write time, which
* will make more sense
*/
@@ -182,7 +182,7 @@ __blocking void fd_cache_remove(uint128_t oid)
struct fd_cache_entry* tmp_entry;
char log_name [PATH_MAX];
int ret;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
triton_mutex_lock(&fd_mutex);
@@ -216,8 +216,9 @@ __blocking void fd_cache_remove(uint128_t oid)
}
/* actually unlink the log file */
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
sprintf(log_name, "%s/%s.dat", fd_cache_cosd_log_path, oid_str);
+ if (oid_str) free(oid_str);
aefile_unlink(log_name);
@@ -231,7 +232,7 @@ __blocking triton_ret_t fd_cache_get(struct fd_cache_entry **entry, uint128_t oi
struct fd_cache_entry* new_entry;
char log_name [PATH_MAX];
int posix_open_flags = O_RDWR|O_CREAT;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
struct stat statbuf;
int rc, rc_tmp;
@@ -279,8 +280,9 @@ __blocking triton_ret_t fd_cache_get(struct fd_cache_entry **entry, uint128_t oi
posix_open_flags |= O_DSYNC;
/* actually open the file */
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, oid);
+ oid_str = triton_uint128_to_string(oid);
sprintf(log_name, "%s/%s.dat", fd_cache_cosd_log_path, oid_str);
+ if (oid_str) free(oid_str);
rc = aefile_open(log_name, posix_open_flags,
S_IRUSR|S_IWUSR);
if(rc < 0)
@@ -403,7 +405,7 @@ static void fd_cache_destructor(struct fd_cache_entry* entry)
{
struct stat statbuf;
int ret;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
/* we have done something wrong if this is still in use */
assert(entry->ref_count == 0);
@@ -418,11 +420,11 @@ static void fd_cache_destructor(struct fd_cache_entry* entry)
ret = ftruncate(entry->fd, entry->log_offset);
if(ret < 0)
{
- triton_uint128_to_string(oid_str,
- TRITON_UINT128_STRLEN, entry->oid);
+ oid_str = triton_uint128_to_string(entry->oid);
triton_error_msg(
"Failed to truncate object %s, continuing\n",
oid_str);
+ if (oid_str) free(oid_str);
/* will show up as an error at write time, which
* will make more sense
*/
diff --git a/code/src/transactional-osd/transactional-osd.ae b/code/src/transactional-osd/transactional-osd.ae
index ded0bd2..0d7b900 100644
--- a/code/src/transactional-osd/transactional-osd.ae
+++ b/code/src/transactional-osd/transactional-osd.ae
@@ -2160,7 +2160,7 @@ __blocking triton_ret_t tosd_dump(void)
DBT log_map_key, missing_ver_key, ver_key, nd_key;
DBT log_map_value, missing_ver_value, ver_value, nd_value;
int c_get_flag = DB_SET_RANGE;
- char oid_str[TRITON_UINT128_STRLEN];
+ char *oid_str;
struct niid_key nkey;
struct niid_value nvalue;
int ret;
@@ -2233,10 +2233,11 @@ __blocking triton_ret_t tosd_dump(void)
tret = triton_ret_from_bdb(ret);
while (tret == TRITON_SUCCESS)
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, vk);
+ oid_str = triton_uint128_to_string(vk);
printf("OID: %s\n", oid_str);
printf("=============================================\n");
printf(" version: %llu\n", llu(vv));
+ if (oid_str) free(oid_str);
/* search for any missing versions */
printf(" missing versions: ");
@@ -2332,9 +2333,10 @@ __blocking triton_ret_t tosd_dump(void)
tret = triton_ret_from_bdb(ret);
while (tret == TRITON_SUCCESS)
{
- triton_uint128_to_string(oid_str, TRITON_UINT128_STRLEN, nkey.oid);
+ oid_str = triton_uint128_to_string(nkey.oid);
printf("OID: %s, NIID: %llu, op_type: %d, timestamp: %lld\n", oid_str,
llu(nkey.niid), nkey.op_type, lld(nvalue.timestamp));
+ if (oid_str) free(oid_str);
ret = aebdb_cursor_get(niid_dbcp, &nd_key, &nd_value, DB_NEXT);
tret = triton_ret_from_bdb(ret);
}
diff --git a/code/tests/placement/test-placement.c b/code/tests/placement/test-placement.c
index 8fbab76..59ea08f 100644
--- a/code/tests/placement/test-placement.c
+++ b/code/tests/placement/test-placement.c
@@ -9,7 +9,7 @@ int main(int argc, char *argv[])
triton_node_t closest[3];
uint128_t oid;
int i;
- char id_str[TRITON_UINT128_STRLEN];
+ char *id_str;
servers[0] = triton_uint128_from_uint64(1);
servers[1] = triton_uint128_from_uint64(UINT64_MAX/4ULL);
@@ -32,15 +32,18 @@ int main(int argc, char *argv[])
printf("all servers:\n");
for(i=0; i<4; i++)
{
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, servers[i]);
+ id_str = triton_uint128_to_string(servers[i]);
printf("\t%s\n", id_str);
+ if (id_str) free(id_str);
}
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, oid);
+ id_str = triton_uint128_to_string(oid);
printf("closest to OID: %s:\n", id_str);
+ if (id_str) free(id_str);
for(i=0; i<3; i++)
{
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, closest[i]);
+ id_str = triton_uint128_to_string(closest[i]);
printf("\t%s\n", id_str);
+ if (id_str) free(id_str);
}
printf("\n");
@@ -60,15 +63,18 @@ int main(int argc, char *argv[])
printf("all servers:\n");
for(i=0; i<4; i++)
{
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, servers[i]);
+ id_str = triton_uint128_to_string(servers[i]);
printf("\t%s\n", id_str);
+ if (id_str) free(id_str);
}
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, oid);
+ id_str = triton_uint128_to_string(oid);
printf("closest to OID: %s:\n", id_str);
+ if (id_str) free(id_str);
for(i=0; i<3; i++)
{
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, closest[i]);
+ id_str = triton_uint128_to_string(closest[i]);
printf("\t%s\n", id_str);
+ if (id_str) free(id_str);
}
printf("\n");
@@ -94,15 +100,18 @@ int main(int argc, char *argv[])
printf("all servers:\n");
for(i=0; i<4; i++)
{
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, servers[i]);
+ id_str = triton_uint128_to_string(servers[i]);
printf("\t%s\n", id_str);
+ if (id_str) free(id_str);
}
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, oid);
+ id_str = triton_uint128_to_string(oid);
printf("closest to OID: %s:\n", id_str);
+ if (id_str) free(id_str);
for(i=0; i<3; i++)
{
- triton_uint128_to_string(id_str, TRITON_UINT128_STRLEN, closest[i]);
+ id_str = triton_uint128_to_string(closest[i]);
printf("\t%s\n", id_str);
+ if (id_str) free(id_str);
}
printf("\n");
diff --git a/code/tests/system-state/test-system-state.ae b/code/tests/system-state/test-system-state.ae
index b345b46..3cd8288 100644
--- a/code/tests/system-state/test-system-state.ae
+++ b/code/tests/system-state/test-system-state.ae
@@ -13,7 +13,7 @@ __blocking int aesop_main(int argc, char **argv)
triton_ret_t tret;
triton_node_t node1;
char* ser;
- const char* load_test = "<0000000000000000.0000000000000001><testkey><foo>,<0000000000000000.0000000000000002><testkey><foo>,<0000000000000000.0000000000000001><testkeyB><foo>,<0000000000000000.0000000000000002><testkeyB><foo>";
+ const char* load_test = "<::1><testkey><foo>,<::2><testkey><foo>,<::1><testkeyB><foo>,<::2><testkeyB><foo>";
char* val;
triton_node_t* node_array;
int node_array_count;
diff --git a/code/tests/test-util.sh b/code/tests/test-util.sh
index 1eca563..f6988e3 100644
--- a/code/tests/test-util.sh
+++ b/code/tests/test-util.sh
@@ -39,7 +39,7 @@ function test_start_servers ()
echo "# auto-generated host file from test pid $pid, $nservers servers" > /tmp/triton-hosts-$pid.txt
for i in `seq $startport $endport`
do
- echo -e "0.$i\ttcp://localhost:$i" >> /tmp/triton-hosts-$pid.txt
+ echo -e "::$i\ttcp://localhost:$i" >> /tmp/triton-hosts-$pid.txt
done
# start daemons
diff --git a/code/tests/triton-rm.sh b/code/tests/triton-rm.sh
index 6a1cdf3..bf7b4f2 100755
--- a/code/tests/triton-rm.sh
+++ b/code/tests/triton-rm.sh
@@ -14,7 +14,7 @@ test_start_servers 4 15
# delete non-existent file
#####################
-src/admin-tools/triton-rm --verbose --server $svr1 2.1
+src/admin-tools/triton-rm --verbose --server $svr1 ::2:0:0:0:1
if [ $? -ne 0 ]; then
src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null
test_fini
@@ -24,8 +24,8 @@ fi
# delete existing file w/ default replication
#####################
-src/admin-tools/triton-touch $svr1 3.1 3
-src/admin-tools/triton-rm --verbose --server $svr1 3.1
+src/admin-tools/triton-touch $svr1 ::3:0:0:0:1 3
+src/admin-tools/triton-rm --verbose --server $svr1 ::3:0:0:0:1
if [ $? -ne 0 ]; then
src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null
test_fini
@@ -35,8 +35,8 @@ fi
# delete existing file w/ default replication
#####################
-src/admin-tools/triton-touch $svr1 4.1 4
-src/admin-tools/triton-rm --verbose --server $svr1 4.1
+src/admin-tools/triton-touch $svr1 ::4:0:0:0:1 4
+src/admin-tools/triton-rm --verbose --server $svr1 ::4:0:0:0:1
if [ $? -ne 0 ]; then
src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null
test_fini
diff --git a/code/tests/triton-start-test-servers.sh b/code/tests/triton-start-test-servers.sh
index 275472d..932bba8 100755
--- a/code/tests/triton-start-test-servers.sh
+++ b/code/tests/triton-start-test-servers.sh
@@ -14,7 +14,7 @@ endport=`expr 3344 + $nservers - 1`
echo "# auto-generated host file from test pid $pid, $nservers servers" > /tmp/triton-hosts-$pid.txt
for i in `seq $startport $endport`
do
- echo -e "0.$i\ttcp://localhost:$i" >> /tmp/triton-hosts-$pid.txt
+ echo -e "::$i\ttcp://localhost:$i" >> /tmp/triton-hosts-$pid.txt
done
# start daemons
diff --git a/code/tests/triton-touch.sh b/code/tests/triton-touch.sh
index d15e52c..780c75b 100755
--- a/code/tests/triton-touch.sh
+++ b/code/tests/triton-touch.sh
@@ -14,7 +14,7 @@ test_start_servers 4 15
# actual test case
#####################
-src/admin-tools/triton-touch $svr1 1.1 3
+src/admin-tools/triton-touch $svr1 ::1:0:0:0:1 3
if [ $? -ne 0 ]; then
src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null
test_fini
hooks/post-receive
--