Skip to content

Commit

Permalink
Merge branch 'master' into lxz/test_tgt_nr
Browse files Browse the repository at this point in the history
Required-githooks: true
  • Loading branch information
liuxuezhao committed Jul 18, 2023
2 parents 5b2096c + 2ce37ca commit ff6d0b4
Show file tree
Hide file tree
Showing 173 changed files with 4,225 additions and 1,471 deletions.
4 changes: 2 additions & 2 deletions ci/jira_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# Expected components from the commit message, and directory in src/, src/client or utils/ is also
# valid. We've never checked/enforced these before so there have been a lot of values used in the
# past.
VALID_COMPONENTS = ('agent', 'build', 'ci', 'csum', 'doc', 'gha', 'il', 'md', 'mercury', 'pil4dfs',
'swim', 'test', 'tools')
VALID_COMPONENTS = ('agent', 'build', 'ci', 'csum', 'doc', 'gha', 'il', 'md', 'mercury',
'packaging', 'pil4dfs', 'swim', 'test', 'tools')

# Expected ticket prefix.
VALID_TICKET_PREFIX = ('DAOS', 'CORCI', 'SRE')
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
daos (2.5.100-7) unstable; urgency=medium
[ Brian J. Murrell ]
* NOOP change to keep in parity with RPM version

-- Brian J. Murrell <brian.murrell@intel.com> Fri, 07 Jul 2023 16:05:01 -0400

daos (2.5.100-6) unstable; urgency=medium
[Michael MacDonald]
* Add golang-go as a tests dependency for dfuse/daos_build.py
Expand Down
9 changes: 9 additions & 0 deletions docs/admin/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ fabric_iface_port: 31316
# engine 1
fabric_iface_port: 31416
```
### daos_agent cache of engine URIs is stale

The `daos_agent` cache may become invalid if `daos_engine` processes restart with different
configurations or IP addresses, or if the DAOS system is reformatted.
If this happens, the `daos` tool (as well as other I/O or `libdaos` operations) may return
`-DER_BAD_TARGET` (-1035) errors.

To resolve the issue, a privileged user may send a `SIGUSR2` signal to the `daos_agent` process to
force an immediate cache refresh.

## Diagnostic and Recovery Tools

Expand Down
24 changes: 24 additions & 0 deletions docs/user/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,30 @@ These are two command line options to control the DFuse process itself.

These will affect all containers accessed via DFuse, regardless of any container attributes.

### Managing memory usage and disconnecting from containers

DFuse can be instructed to evict paths from local memory which drops any open handles on containers
or pools as well as reducing the working set size and memory consumption. This is an asynchronous
operation and there is no automatic way to tell if it's completed. In addition, any lookup of the
path specified in the eviction call will cause a new lookup and prevent the eviction from
completing.

Paths can be requested for eviction from dfuse using the `daos filesystem evict` command. This does
not change any data that is stored in DAOS in any way but rather releases local resources. This
command will return the inode number of the path as well as key dfuse metrics.

DFuse metrics can be queried with the `daos filesystem query` command which takes an optional
`--inode` parameter. This will return information on the number of inodes held in memory, the
number of open files as well as the number of pools and containers that DFuse is connected to. If
the `--inode` option is given then this command will also report if the inode is in memory or not.

Together these two commands can be used to request eviction of a path and to poll for its release,
although lookups from other processes might block the eviction process.

If `daos filesystem evict` is passed the root of the DFuse mount then the path itself cannot be
evicted - in this case all top-level entries in the directory are evicted instead and no inode
number is returned.

### Permissions

DFuse can serve data from any user's container, but needs appropriate permissions in order to do
Expand Down
2 changes: 2 additions & 0 deletions site_scons/env_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def _module_func(self, command, *arguments): # pylint: disable=no-self-use
except OSError as error:
if error.errno == errno.ENOENT:
return None, None
raise

stdout, stderr = proc.communicate()

Expand Down Expand Up @@ -189,6 +190,7 @@ def load_mpi(mpi):
print("Error running update-alternatives")
if error.errno == errno.ENOENT:
return False
raise
for line in proc.stdout.readlines():
if line.startswith(b"Value:"):
if line[line.rfind(b".") + 1:-1].decode() == mpi:
Expand Down
29 changes: 17 additions & 12 deletions src/bio/bio_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,16 +1859,19 @@ alloc_copy_desc(struct bio_io_context *ioctxt, struct umem_instance *umem,
return NULL;
}

struct bio_copy_desc *
int
bio_copy_prep(struct bio_io_context *ioctxt, struct umem_instance *umem,
struct bio_sglist *bsgl_src, struct bio_sglist *bsgl_dst)
struct bio_sglist *bsgl_src, struct bio_sglist *bsgl_dst,
struct bio_copy_desc **desc)
{
struct bio_copy_desc *copy_desc;
int rc;
int rc, ret;

copy_desc = alloc_copy_desc(ioctxt, umem, bsgl_src, bsgl_dst);
if (copy_desc == NULL)
return NULL;
if (copy_desc == NULL) {
*desc = NULL;
return -DER_NOMEM;
}

rc = bio_iod_prep(copy_desc->bcd_iod_src, BIO_CHK_TYPE_LOCAL, NULL, 0);
if (rc)
Expand All @@ -1877,15 +1880,17 @@ bio_copy_prep(struct bio_io_context *ioctxt, struct umem_instance *umem,
copy_desc->bcd_iod_dst->bd_copy_dst = 1;
rc = bio_iod_prep(copy_desc->bcd_iod_dst, BIO_CHK_TYPE_LOCAL, NULL, 0);
if (rc) {
rc = bio_iod_post(copy_desc->bcd_iod_src, 0);
D_ASSERT(rc == 0);
ret = bio_iod_post(copy_desc->bcd_iod_src, 0);
D_ASSERT(ret == 0);
goto free;
}

return copy_desc;
*desc = copy_desc;
return 0;
free:
free_copy_desc(copy_desc);
return NULL;
*desc = NULL;
return rc;
}

int
Expand Down Expand Up @@ -1950,9 +1955,9 @@ bio_copy(struct bio_io_context *ioctxt, struct umem_instance *umem,
struct bio_copy_desc *copy_desc;
int rc;

copy_desc = bio_copy_prep(ioctxt, umem, bsgl_src, bsgl_dst);
if (copy_desc == NULL)
return -DER_NOMEM;
rc = bio_copy_prep(ioctxt, umem, bsgl_src, bsgl_dst, &copy_desc);
if (rc)
return rc;

rc = bio_copy_run(copy_desc, copy_size, csum_desc);
rc = bio_copy_post(copy_desc, rc);
Expand Down
6 changes: 3 additions & 3 deletions src/bio/bio_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ blob_wait_completion(struct bio_xs_context *xs_ctxt, struct blob_cp_arg *ba)
} else {
rc = ABT_eventual_wait(ba->bca_eventual, NULL);
if (rc != ABT_SUCCESS)
D_ERROR("ABT eventual wait failed. %d", rc);
D_ERROR("ABT eventual wait failed. %d\n", rc);
}
}

Expand Down Expand Up @@ -967,13 +967,13 @@ int bio_mc_open(struct bio_xs_context *xs_ctxt, uuid_t pool_id,
close_wal_ioctxt:
rc1 = bio_ioctxt_close(bio_mc->mc_wal);
if (rc1)
D_ERROR("Failed to close wal ioctxt. %d", rc1);
D_ERROR("Failed to close wal ioctxt. %d\n", rc1);
close_meta:
meta_close(bio_mc);
close_meta_ioctxt:
rc1 = bio_ioctxt_close(bio_mc->mc_meta);
if (rc1)
D_ERROR("Failed to close meta ioctxt. %d", rc1);
D_ERROR("Failed to close meta ioctxt. %d\n", rc1);
free_mem:
D_FREE(bio_mc);

Expand Down
2 changes: 1 addition & 1 deletion src/bio/bio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ led_device_action(void *ctx, struct spdk_pci_device *pci_device)
break;
case CTL__LED_ACTION__RESET:
/* Reset intercepted earlier in call-stack and converted to set */
D_ERROR("Reset action is not supported");
D_ERROR("Reset action is not supported\n");
opts->status = -DER_INVAL;
return;
default:
Expand Down
9 changes: 8 additions & 1 deletion src/bio/bio_xstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ bio_nvme_init(const char *nvme_conf, int numa_node, unsigned int mem_size,
goto free_cond;
}

/*
* Let's keep using large cluster size(1GB) for pmem mode, the SPDK blobstore
* loading time is unexpected long for smaller cluster size(32MB), see DAOS-13694.
*/
if (!bio_nvme_configured(SMD_DEV_TYPE_META))
nvme_glb.bd_bs_opts.cluster_sz = (1UL << 30); /* 1GB */

D_INFO("MD on SSD is %s\n",
bio_nvme_configured(SMD_DEV_TYPE_META) ? "enabled" : "disabled");

Expand Down Expand Up @@ -954,7 +961,7 @@ init_bio_bdevs(struct bio_xs_context *ctxt)

D_ASSERT(!is_server_started());
if (spdk_bdev_first() == NULL) {
D_ERROR("No SPDK bdevs found!");
D_ERROR("No SPDK bdevs found!\n");
rc = -DER_NONEXIST;
}

Expand Down
6 changes: 6 additions & 0 deletions src/cart/crt_corpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ crt_corpc_initiate(struct crt_rpc_priv *rpc_priv)
struct crt_grp_gdata *grp_gdata;
struct crt_grp_priv *grp_priv;
struct crt_corpc_hdr *co_hdr;
int src_timeout;
bool grp_ref_taken = false;
int rc = 0;

Expand Down Expand Up @@ -121,6 +122,10 @@ crt_corpc_initiate(struct crt_rpc_priv *rpc_priv)
}
}

/* Inherit a timeout from a source */
src_timeout = rpc_priv->crp_req_hdr.cch_src_timeout;
rpc_priv->crp_timeout_sec = src_timeout;

rc = crt_corpc_info_init(rpc_priv, grp_priv, grp_ref_taken,
co_hdr->coh_filter_ranks,
co_hdr->coh_grp_ver /* grp_ver */,
Expand Down Expand Up @@ -874,6 +879,7 @@ crt_corpc_req_hdlr(struct crt_rpc_priv *rpc_priv)
child_rpc_priv = container_of(child_rpc, struct crt_rpc_priv,
crp_pub);

child_rpc_priv->crp_timeout_sec = rpc_priv->crp_timeout_sec;
corpc_add_child_rpc(rpc_priv, child_rpc_priv);

child_rpc_priv->crp_grp_priv = co_info->co_grp_priv;
Expand Down
9 changes: 4 additions & 5 deletions src/cart/crt_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -1826,24 +1826,23 @@ crt_group_config_path_set(const char *path)
int rc;

if (path == NULL) {
D_ERROR("path can't be NULL");
D_ERROR("path can't be NULL\n");
return -DER_INVAL;
}

if (strlen(path) >= CRT_MAX_ATTACH_PREFIX) {
D_ERROR("specified path must be fewer than %d characters",
CRT_MAX_ATTACH_PREFIX);
D_ERROR("specified path must be fewer than %d characters\n", CRT_MAX_ATTACH_PREFIX);
return -DER_INVAL;
}

rc = stat(path, &buf);
if (rc != 0) {
D_ERROR("bad path specified: %s", path);
D_ERROR("bad path specified: %s\n", path);
return d_errno2der(errno);
}

if (!S_ISDIR(buf.st_mode)) {
D_ERROR("not a directory: %s", path);
D_ERROR("not a directory: %s\n", path);
return -DER_NOTDIR;
}

Expand Down
1 change: 1 addition & 0 deletions src/cart/crt_hg_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ crt_proc_in_common(crt_proc_t proc, crt_rpc_input_t *data)
);
hdr->cch_dst_tag = rpc_priv->crp_pub.cr_ep.ep_tag;

hdr->cch_src_timeout = rpc_priv->crp_timeout_sec;
if (crt_is_service()) {
hdr->cch_src_rank =
crt_grp_priv_get_primary_rank(
Expand Down
12 changes: 7 additions & 5 deletions src/cart/crt_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ crt_hdlr_iv_sync_aux(void *arg)
break;

default:
D_ERROR("Unknown event type %#x", sync_type->ivs_event);
D_ERROR("Unknown event type %#x\n", sync_type->ivs_event);
D_GOTO(exit, rc = -DER_INVAL);
break;
}
Expand Down Expand Up @@ -2551,8 +2551,7 @@ handle_ivupdate_response(const struct crt_cb_info *cb_info)

/* Respond back to child; might fail if child is not alive */
if (crt_reply_send(iv_info->uci_child_rpc) != DER_SUCCESS)
D_ERROR("Failed to respond on rpc: %p",
iv_info->uci_child_rpc);
D_ERROR("Failed to respond on rpc: %p\n", iv_info->uci_child_rpc);

/* ADDREF done in crt_hdlr_iv_update */
RPC_PUB_DECREF(iv_info->uci_child_rpc);
Expand Down Expand Up @@ -3306,8 +3305,11 @@ crt_iv_update_internal(crt_iv_namespace_t ivns, uint32_t class_id,
D_GOTO(exit, rc);
}

rc = iv_ops->ivo_on_get(ivns, iv_key,
0, CRT_IV_PERM_WRITE, NULL, &priv);
rc = iv_ops->ivo_on_get(ivns, iv_key, 0, CRT_IV_PERM_WRITE, NULL, &priv);
if (rc != 0) {
D_ERROR("ivo_on_get(): " DF_RC, DP_RC(rc));
D_GOTO(exit, rc);
}

if (iv_value != NULL)
rc = iv_ops->ivo_on_update(ivns, iv_key, 0,
Expand Down
22 changes: 22 additions & 0 deletions src/cart/crt_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,28 @@ crt_req_dst_tag_get(crt_rpc_t *rpc, uint32_t *tag)
return rc;
}

int
crt_req_src_timeout_get(crt_rpc_t *rpc, uint16_t *timeout)
{
struct crt_rpc_priv *rpc_priv = NULL;
int rc = 0;

if (rpc == NULL) {
D_ERROR("NULL rpc passed\n");
D_GOTO(out, rc = -DER_INVAL);
}

if (timeout == NULL) {
D_ERROR("NULL timeout passed\n");
D_GOTO(out, rc = -DER_INVAL);
}

rpc_priv = container_of(rpc, struct crt_rpc_priv, crp_pub);
*timeout = rpc_priv->crp_req_hdr.cch_src_timeout;
out:
return rc;
}

int
crt_register_hlc_error_cb(crt_hlc_error_cb event_handler, void *arg)
{
Expand Down
7 changes: 5 additions & 2 deletions src/cart/crt_rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ struct crt_common_hdr {
d_rank_t cch_dst_rank;
/* originator rank in default primary group */
d_rank_t cch_src_rank;
/* tag to which rpc request was sent to */
uint32_t cch_dst_tag;
/* destination tag */
uint16_t cch_dst_tag;
/* source timeout, to be replaced by deadline eventually */
uint16_t cch_src_timeout;
/* used in crp_reply_hdr to propagate rpc failure back to sender */
uint32_t cch_rc;
};


typedef enum {
RPC_STATE_INITED = 0x36,
RPC_STATE_QUEUED, /* queued for flow controlling */
Expand Down
2 changes: 1 addition & 1 deletion src/client/api/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ craft_default_jobid(char **jobid)

ret = uname(&name);
if (ret) {
D_ERROR("Uname to get uname for creating default jobid");
D_ERROR("Uname to get uname for creating default jobid\n");
return daos_errno2der(errno);
}

Expand Down
4 changes: 2 additions & 2 deletions src/client/dfs/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3156,7 +3156,7 @@ dfs_obj_set_oclass(dfs_t *dfs, dfs_obj_t *obj, int flags, daos_oclass_id_t cid)
rc = daos_obj_update(oh, DAOS_TX_NONE, DAOS_COND_DKEY_UPDATE, &dkey, 1,
&iod, &sgl, NULL);
if (rc) {
D_ERROR("Failed to update object class ("DF_RC")\n", DP_RC(rc));
D_ERROR("Failed to update object class: " DF_RC "\n", DP_RC(rc));
D_GOTO(out, rc = daos_der2errno(rc));
}

Expand Down Expand Up @@ -3206,7 +3206,7 @@ set_chunk_size(dfs_t *dfs, dfs_obj_t *obj, daos_size_t csize)
rc = daos_obj_update(oh, DAOS_TX_NONE, DAOS_COND_DKEY_UPDATE, &dkey, 1,
&iod, &sgl, NULL);
if (rc) {
D_ERROR("Failed to update chunk size ("DF_RC")\n", DP_RC(rc));
D_ERROR("Failed to update chunk size: " DF_RC "\n", DP_RC(rc));
D_GOTO(out, rc = daos_der2errno(rc));
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/dfs/duns.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ create_cont(daos_handle_t poh, struct duns_attr_t *attrp, bool create_with_label

prop = daos_prop_alloc(nr);
if (prop == NULL) {
D_ERROR("Failed to allocate container prop.");
D_ERROR("Failed to allocate container prop.\n");
return ENOMEM;
}
if (attrp->da_props != NULL) {
Expand Down
5 changes: 3 additions & 2 deletions src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ struct dfuse_obj_hdl {
bool doh_kreaddir_started;
/* Set to true if readdir calls reach EOF made on this handle */
bool doh_kreaddir_finished;

bool doh_evict_on_close;
};

/* Readdir support.
Expand Down Expand Up @@ -707,8 +709,7 @@ struct fuse_lowlevel_ops dfuse_ops;
strerror(-__rc)); \
} while (0)

#define DFUSE_REPLY_IOCTL(desc, req, arg) \
DFUSE_REPLY_IOCTL_SIZE(desc, req, &(arg), sizeof(arg))
#define DFUSE_REPLY_IOCTL(desc, req, arg) DFUSE_REPLY_IOCTL_SIZE(desc, req, &(arg), sizeof(arg))

/**
* Inode handle.
Expand Down
Loading

0 comments on commit ff6d0b4

Please sign in to comment.