Skip to content

Commit

Permalink
Merge branch 'master' into daos-6338
Browse files Browse the repository at this point in the history
Skip-build: true
Skip-test: true

Signed-off-by: Hua Kuang <[email protected]>

Conflicts:
	utils/rpms/daos.spec

Change-Id: I8c60c039df015393d73f9817d21fbec8a2c410c5
  • Loading branch information
GitHuaKuang committed Feb 3, 2021
2 parents 074657d + 65b3c33 commit 569b142
Show file tree
Hide file tree
Showing 162 changed files with 6,599 additions and 1,772 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ String functional_packages(String distro) {
"mpi4py-tests " +
"hdf5-mpich-tests " +
"hdf5-openmpi3-tests " +
"hdf5-vol-daos-mpich2-tests-daos-1 " +
"hdf5-vol-daos-openmpi3-tests-daos-1 " +
"hdf5-vol-daos-mpich-tests " +
"hdf5-vol-daos-openmpi3-tests " +
"MACSio-mpich " +
"MACSio-openmpi3 " +
"mpifileutils-mpich-daos-1 "
Expand Down
31 changes: 31 additions & 0 deletions doc/graph/pool_component_state_transition_diagram.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* This is a Graphviz diagram specification for the pool map state transitions
*
* You can compile it by installing graphviz and running:
* dot -Tpng -o pool_component_state_transition_diagram.png < pool_component_state_transition_diagram.gv
*/

digraph finite_state_machine {
rankdir=LR;
size="20,20"
node [shape = doublecircle, width = 1.1]; UPIN;
node [shape = none, width = 0, fixedsize = true]; _
node [shape = circle, width = 1.1];

NEW [ label = "NEW\nfseq == 0" ];
NEW_UNHEALTHY [ label = "NEW\nfseq != 0" ];
_ [ label = "" ];

_ -> NEW [ label = "Extend" ];
NEW -> NEW_UNHEALTHY [ label = "Failed" ];
NEW_UNHEALTHY -> DOWN [ label = "Extend Complete" ];
NEW -> UPIN [ label = "Extended" ];
UPIN -> DOWN [ label = "Failed" ];
UPIN -> DRAIN [ label = "Drain" ];
DRAIN -> DOWN [ label = "Failed" ];
DRAIN -> DOWNOUT [ label = "Drained" ];
DOWN -> DOWNOUT [ label = "Rebuilt" ];
UP -> UPIN [ label = "Reintegrated" ];
DOWNOUT -> UP [ label = "Reintegrate" ];
UP -> DOWNOUT [ label = "Failed" ];
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/bio/bio_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,12 @@ copy_one(struct bio_desc *biod, struct bio_iov *biov,
return -DER_INVAL;
}

if (iov->iov_buf == NULL) {
D_ERROR("Invalid iov[%d], iov_buf is NULL\n",
arg->ca_iov_idx);
return -DER_INVAL;
}

nob = min(size, buf_len - arg->ca_iov_off);
if (addr != NULL) {
D_DEBUG(DB_TRACE, "bio copy %p size %zd\n",
Expand Down
56 changes: 47 additions & 9 deletions src/cart/crt_hlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@
#include <gurt/atomic.h>
#include <time.h>

#define CRT_HLC_MASK 0xFFFFULL
/**
* HLC timestamp unit (given in the HLC timestamp value for 1 ns) (i.e.,
* 1/16 ns, offering a 36-year range)
*/
#define CRT_HLC_NSEC 16ULL

/**
* HLC start time (given in the Unix time for 2021-01-01 00:00:00 +0000 UTC in
* seconds) (i.e., together with CRT_HLC_NSEC, offering a range of [2021, 2057])
*/
#define CRT_HLC_START_SEC 1609459200ULL

/** Mask for the 18 logical bits */
#define CRT_HLC_MASK 0x3FFFFULL

static ATOMIC uint64_t crt_hlc;

/** See crt_hlc_epsilon_set's API doc */
static uint64_t crt_hlc_epsilon = 1000 * 1000 * 1000;
static uint64_t crt_hlc_epsilon = 1ULL * NSEC_PER_SEC * CRT_HLC_NSEC;

/** Get local physical time */
static inline uint64_t crt_hlc_localtime_get(void)
Expand All @@ -26,12 +39,12 @@ static inline uint64_t crt_hlc_localtime_get(void)
int rc;

rc = clock_gettime(CLOCK_REALTIME, &now);
pt = rc ? crt_hlc : (now.tv_sec * NSEC_PER_SEC + now.tv_nsec);
D_ASSERTF(rc == 0, "clock_gettime: %d\n", errno);
D_ASSERT(now.tv_sec > CRT_HLC_START_SEC);
pt = ((now.tv_sec - CRT_HLC_START_SEC) * NSEC_PER_SEC + now.tv_nsec) *
CRT_HLC_NSEC;

/**
* Return the most significant 48 bits of time.
* In case of error of retrieving a system time use previous time.
*/
/** Return the most significant 46 bits of time. */
return pt & ~CRT_HLC_MASK;
}

Expand Down Expand Up @@ -79,9 +92,34 @@ int crt_hlc_get_msg(uint64_t msg, uint64_t *hlc_out, uint64_t *offset)
return 0;
}

uint64_t crt_hlc2sec(uint64_t hlc)
uint64_t crt_hlc2nsec(uint64_t hlc)
{
return hlc / CRT_HLC_NSEC;
}

uint64_t crt_nsec2hlc(uint64_t nsec)
{
return (hlc & ~CRT_HLC_MASK) / NSEC_PER_SEC;
return nsec * CRT_HLC_NSEC;
}

uint64_t crt_hlc2unixnsec(uint64_t hlc)
{
return hlc / CRT_HLC_NSEC + CRT_HLC_START_SEC * NSEC_PER_SEC;
}

uint64_t crt_unixnsec2hlc(uint64_t unixnsec)
{
uint64_t start = CRT_HLC_START_SEC * NSEC_PER_SEC;

/*
* If the time represented by unixnsec is before the time represented
* by CRT_HLC_START_SEC, or after the maximum time representable, then
* the conversion is impossible.
*/
if (unixnsec < start || unixnsec - start > (uint64_t)-1 / CRT_HLC_NSEC)
return 0;

return (unixnsec - start) * CRT_HLC_NSEC;
}

void crt_hlc_epsilon_set(uint64_t epsilon)
Expand Down
4 changes: 2 additions & 2 deletions src/cart/crt_rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ struct crt_rpc_priv {
struct crt_corpc_hdr crp_coreq_hdr; /* collective request header */
};

#define CRT_PROTO_INTERNAL_VERSION 2
#define CRT_PROTO_FI_VERSION 0
#define CRT_PROTO_INTERNAL_VERSION 3
#define CRT_PROTO_FI_VERSION 1

/* LIST of internal RPCS in form of:
* OPCODE, flags, FMT, handler, corpc_hdlr,
Expand Down
16 changes: 8 additions & 8 deletions src/cart/crt_swim.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ static void crt_swim_srv_cb(crt_rpc_t *rpc_req)
* this request.
*/
if (hlc > rpc_priv->crp_req_hdr.cch_hlc)
rcv_delay = (hlc - rpc_priv->crp_req_hdr.cch_hlc)
/ NSEC_PER_MSEC;
rcv_delay = crt_hlc2msec(hlc - rpc_priv->crp_req_hdr.cch_hlc);

/* Update all piggybacked members with remote delays */
D_SPIN_LOCK(&csm->csm_lock);
Expand All @@ -181,10 +180,11 @@ static void crt_swim_srv_cb(crt_rpc_t *rpc_req)

if (crt_swim_fail_delay &&
crt_swim_fail_id == id) {
crt_swim_fail_hlc = hlc
- l * NSEC_PER_MSEC
+ crt_swim_fail_delay
* NSEC_PER_SEC;
uint64_t d = crt_swim_fail_delay;

crt_swim_fail_hlc = hlc -
crt_msec2hlc(l) +
crt_sec2hlc(d);
crt_swim_fail_delay = 0;
}
break;
Expand Down Expand Up @@ -282,8 +282,8 @@ static void crt_swim_cli_cb(const struct crt_cb_info *cb_info)

out:
if (crt_swim_fail_delay && crt_swim_fail_id == self_id) {
crt_swim_fail_hlc = crt_hlc_get()
+ crt_swim_fail_delay * NSEC_PER_SEC;
crt_swim_fail_hlc = crt_hlc_get() +
crt_sec2hlc(crt_swim_fail_delay);
crt_swim_fail_delay = 0;
}

Expand Down
Loading

0 comments on commit 569b142

Please sign in to comment.