Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/container/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,6 @@ dc_cont_create(tse_task_t *task)

args = dc_task_get_args(task);

if (!daos_uuid_valid(args->uuid))
/** generate a UUID for the new container */
uuid_generate(args->uuid);

entry = daos_prop_entry_get(args->prop, DAOS_PROP_CO_STATUS);
if (entry != NULL) {
rc = -DER_INVAL;
Expand All @@ -391,6 +387,9 @@ dc_cont_create(tse_task_t *task)
rc = cont_task_create_priv(task, &tpriv);
if (rc != 0)
goto err_prop;

/** generate a UUID for the new container */
uuid_generate(args->uuid);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we consider the overall change as a DAOS API change, should we remove field daos_cont_create_t.uuid?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you do want to return the uuid generated for the container to the user still i assume

}

D_DEBUG(DB_MD, DF_UUID": creating "DF_UUIDF"\n",
Expand Down
8 changes: 4 additions & 4 deletions src/include/daos_uns.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2019-2024 Intel Corporation.

Check failure on line 2 in src/include/daos_uns.h

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -111,11 +111,11 @@
* is returned as a string in \a da_pool with duns_resolve_path().
*/
uuid_t da_puuid;
/** IN/OUT: (Deprecated) Optional UUID of the cont to be created in duns_create_path().
/** OUT: (Deprecated) Optional UUID of the cont created in duns_create_path().
*
* The UUID will be used to create the container in duns_create_path() if set, otherwise a
* random one will be generated. The cont UUID or label is returned as a string in \a
* da_cont with duns_resolve_path().
* The container UUID is always generated by the DAOS system and users are not permitted to
* specify it; any value set on input is ignored. The generated cont UUID or the label is
* returned as a string in \a da_cont with duns_resolve_path().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I'm most ignorant about. Are there any other changes required? And, if we consider the overall change as a DAOS API change, should we remove this field?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this was in/out. user can specify a uuid, but they don't have to.
i think we don't want to change it, but now DAOS always returns the uuid, so it is only out, which you changed, but can remove the optional since DAOS will return that.
i do not suggest we remove it completely.

*/
uuid_t da_cuuid;
/** IN: (Optional) For a POSIX container, set a default object class for all directories. */
Expand Down
16 changes: 13 additions & 3 deletions src/tests/daos_perf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2018-2023 Intel Corporation.

Check failure on line 2 in src/tests/daos_perf.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -439,16 +439,26 @@

/*
* For daos_perf, if pool/cont uuids are supplied as command line
* arguments it's assumed that the pool/cont were created. If only a
* cont uuid is supplied then a pool and container will be created and
* the cont uuid will be used during creation
* arguments it's assumed that the pool/cont were already created and
* will be opened. Creating a container with a user-specified UUID is
* not allowed; a container UUID may only be supplied together with a
* pool UUID to open an existing container.
*/
if (!uuid_is_null(ts_ctx.tsc_pool_uuid)) {
ts_ctx.tsc_skip_pool_create = true;
if (!uuid_is_null(ts_ctx.tsc_cont_uuid))
ts_ctx.tsc_skip_cont_create = true;
}

if (!uuid_is_null(ts_ctx.tsc_cont_uuid) && !ts_ctx.tsc_skip_cont_create) {
if (ts_ctx.tsc_mpi_rank == 0)
fprintf(stderr,
"creating a container with a user-specified UUID is not "
"allowed; a container UUID may only be provided together "
"with a pool UUID to open an existing container\n");
return -1;
}

if (ts_ctx.tsc_mpi_rank == 0) {
if (!ts_ctx.tsc_skip_cont_create)
uuid_generate(ts_ctx.tsc_cont_uuid);
Expand Down
16 changes: 13 additions & 3 deletions src/tests/daos_racer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2019-2023 Intel Corporation.

Check failure on line 2 in src/tests/daos_racer.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -529,16 +529,26 @@

/*
* For daos_racer, if pool/cont uuids are supplied as command line
* arguments it's assumed that the pool/cont were created. If only a
* cont uuid is supplied then a pool and container will be created and
* the cont uuid will be used during creation
* arguments it's assumed that the pool/cont were already created and
* will be opened. Creating a container with a user-specified UUID is
* not allowed; a container UUID may only be supplied together with a
* pool UUID to open an existing container.
*/
if (!uuid_is_null(ts_ctx.tsc_pool_uuid)) {
ts_ctx.tsc_skip_pool_create = true;
if (!uuid_is_null(ts_ctx.tsc_cont_uuid))
ts_ctx.tsc_skip_cont_create = true;
}

if (!uuid_is_null(ts_ctx.tsc_cont_uuid) && !ts_ctx.tsc_skip_cont_create) {
if (ts_ctx.tsc_mpi_rank == 0)
fprintf(stderr,
"creating a container with a user-specified UUID is not "
"allowed; a container UUID may only be provided together "
"with a pool UUID to open an existing container\n");
D_GOTO(out, rc = -1);
}

if (seed == 0) {
gettimeofday(&tv, NULL);
seed = tv.tv_usec;
Expand Down
Loading