Skip to content

Commit

Permalink
DAOS-15514 container: fix container destroy failure (#14108)
Browse files Browse the repository at this point in the history
The container might be opened when the target is up,
but changed to down when closing. We need to attempt to
close down/downout targets regardless; it won't take any action
if it was not opened before. Failure to properly close it will
result in container destruction failing with EBUSY. (See DAOS-15514)

Required-githooks: true

Change-Id: I82e7c507d5f165057d562455e31d7b02d19e1815
Signed-off-by: Wang Shilong <shilong.wang@intel.com>
  • Loading branch information
wangshilong authored and jolivier23 committed Jun 13, 2024
1 parent 679d381 commit 658f26b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2016-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1724,9 +1724,14 @@ ds_cont_tgt_close(uuid_t pool_uuid, uuid_t hdl_uuid)
struct coll_close_arg arg;

uuid_copy(arg.uuid, hdl_uuid);
return ds_pool_thread_collective(pool_uuid,
PO_COMP_ST_NEW | PO_COMP_ST_DOWN | PO_COMP_ST_DOWNOUT,
cont_close_one_hdl, &arg, 0);

/*
* The container might be opened when the target is up, but changed to down when closing.
* We need to attempt to close down/downout targets regardless; it won't take any action
* if it was not opened before. Failure to properly close it will result in container
* destruction failing with EBUSY. (See DAOS-15514)
*/
return ds_pool_thread_collective(pool_uuid, 0, cont_close_one_hdl, &arg, 0);
}

struct xstream_cont_query {
Expand Down

0 comments on commit 658f26b

Please sign in to comment.