Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-6632 obj: add support for hints on the oclass generate API #4831

Merged
merged 5 commits into from
Mar 25, 2021

Conversation

mchaarawi
Copy link
Contributor

  • choose oclass based on set redundancy and redundance factor of container.
  • adjust oclass if shard sizing is indicated in hint, otherwise use
    max sharding.

Signed-off-by: Mohamad Chaarawi mohamad.chaarawi@intel.com

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@daosbuild1
Copy link
Collaborator

Test stage Scan CentOS 7 RPMs completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-4831/1/execution/node/1161/log

@mchaarawi mchaarawi force-pushed the mschaara/oclass_hints branch from afd0187 to b5e2b50 Compare March 5, 2021 01:38
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@daosbuild1
Copy link
Collaborator

Test stage Scan CentOS 7 RPMs completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-4831/2/execution/node/1150/log

@mchaarawi mchaarawi force-pushed the mschaara/oclass_hints branch from b5e2b50 to 8f0466b Compare March 8, 2021 14:09
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@mchaarawi mchaarawi force-pushed the mschaara/oclass_hints branch from 8f0466b to b53789e Compare March 9, 2021 00:35
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

oclass_auto_setting(void **state)
{
test_arg_t *arg = *state;
uuid_t uuid;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(style) please, no space before tabs

assert_rc_equal(rc, 0);

feat_array = DAOS_OF_DKEY_UINT64 | DAOS_OF_KV_FLAT | DAOS_OF_ARRAY;
feat_byte_array = DAOS_OF_DKEY_UINT64 | DAOS_OF_KV_FLAT | DAOS_OF_ARRAY_BYTE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(style) line over 80 characters

feat_byte_array = DAOS_OF_DKEY_UINT64 | DAOS_OF_KV_FLAT | DAOS_OF_ARRAY_BYTE;
feat_kv = DAOS_OF_KV_FLAT;

prop = daos_prop_alloc(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

(style) code indent should use tabs where possible


print_message("OID settings with container RF0:\n");
/** create container with rf = 0 */
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(style) code indent should use tabs where possible

print_message("OID settings with container RF0:\n");
/** create container with rf = 0 */
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(style) code indent should use tabs where possible

oclass_auto_setting(void **state)
{
test_arg_t *arg = *state;
uuid_t uuid;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
uuid_t uuid;
uuid_t uuid;

feat_byte_array = DAOS_OF_DKEY_UINT64 | DAOS_OF_KV_FLAT | DAOS_OF_ARRAY_BYTE;
feat_kv = DAOS_OF_KV_FLAT;

prop = daos_prop_alloc(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
prop = daos_prop_alloc(1);
prop = daos_prop_alloc(1);

Comment on lines 4206 to 4207
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF0;
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF0;

Comment on lines 4241 to 4242
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF1;
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF1;

Comment on lines 4277 to 4278
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF2;
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF2;

@daosbuild1
Copy link
Collaborator

@mchaarawi mchaarawi force-pushed the mschaara/oclass_hints branch from b53789e to 30bcd35 Compare March 9, 2021 00:40
@daosbuild1 daosbuild1 dismissed their stale review March 9, 2021 00:42

Updated patch

if (res == DAOS_RES_REPL) {
assert_int_equal(attr->u.rp.r_num, nr);
} else if (res == DAOS_RES_EC) {
assert_int_equal(attr->u.ec.e_p, nr-1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert_int_equal(attr->u.ec.e_p, nr-1);
assert_int_equal(attr->u.ec.e_p, nr - 1);

@daosbuild1
Copy link
Collaborator

@daosbuild1 daosbuild1 dismissed their stale review March 9, 2021 00:45

Updated patch

if (res == DAOS_RES_REPL) {
assert_int_equal(attr->u.rp.r_num, nr);
} else if (res == DAOS_RES_EC) {
assert_int_equal(attr->u.ec.e_p, nr-1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert_int_equal(attr->u.ec.e_p, nr-1);
assert_int_equal(attr->u.ec.e_p, nr - 1);

@daosbuild1
Copy link
Collaborator

@mchaarawi mchaarawi force-pushed the mschaara/oclass_hints branch from 30bcd35 to c4c635d Compare March 9, 2021 14:11
@daosbuild1 daosbuild1 dismissed their stale review March 9, 2021 14:13

Updated patch

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

- choose oclass based on set redundancy and redundance factor of container.
- adjust oclass if shard sizing is indicated in hint, otherwise use
  max sharding.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
@mchaarawi mchaarawi force-pushed the mschaara/oclass_hints branch from c4c635d to 6a0bd40 Compare March 9, 2021 21:35
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

#define DAOS_OC_RDD_MAX_VAL ((1ULL << DAOS_OC_RDD_BITS) - 1)
#define DAOS_OC_SHD_MAX_VAL ((1ULL << DAOS_OC_SHD_BITS) - 1)
#define DAOS_OC_RDD_MASK (DAOS_OC_RDD_MAX_VAL << DAOS_OC_RDD_SHIFT)
#define DAOS_OC_SHD_MASK (DAOS_OC_SHD_MAX_VAL << DAOS_OC_SHD_SHIFT)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these bits are for "hints" of the API correct? Then I'd suggest to use a different prefix because DAOS_OC has been used by "class", how about change it to DAOS_OCH_

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok then we would need to make this change to the actual hints that we also merged to 1.2 as this would be an API change now..

return -DER_NOMEM;

prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC;
rc = daos_cont_query(coh, NULL, prop, NULL);
Copy link
Contributor

@gnailzenh gnailzenh Mar 11, 2021

Choose a reason for hiding this comment

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

I think we could potentially get this on container open (it does retrieve some properties), and save the RF in "dc_cont". container query is an expensive operation, if user calls this function for millions of times in a loop, then it might have problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think this might already be retrieved. thanks for pointing that out. will fix/=

- rename hints to add OCH prefix

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@mchaarawi mchaarawi requested a review from gnailzenh March 12, 2021 13:45
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@mchaarawi
Copy link
Contributor Author

@wangdi1 @liuxuezhao @gnailzenh @johannlombardi
could you guys please review? thanks!

switch (rf_factor) {
case DAOS_PROP_CO_REDUN_RF0:
if (rdd == DAOS_OCH_RDD_RP)
cid = OC_RP_2GX;
Copy link
Contributor

Choose a reason for hiding this comment

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

RF0 means has no data protection right? so should be OC_SX for DAOS_OCH_RDD_RP, and seems is invalid parameter if with RF0 and rdd == DAOS_OCH_RDD_EC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RF0 means no data protection as the minimum, but one can still do data protection, right?
this gets set when cont prop is RF0, and user says he wants replication in the hint. i think this should be valid?
if the hint is 0, it gets set to SX.
why is rdd = DAOS_OCH_RDD_EC invalid here?

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, this one looks fine to me.

if (rdd == DAOS_OCH_RDD_RP)
cid = OC_RP_2GX;
else if (rdd == DAOS_OCH_RDD_EC || ofeats & DAOS_OF_ARRAY ||
ofeats & DAOS_OF_ARRAY_BYTE)
Copy link
Contributor

Choose a reason for hiding this comment

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

just confirm that does it mean that dc_array obj always map to EC ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by default, yes if the container has RF > 0

else if (rdd == DAOS_OCH_RDD_EC || ofeats & DAOS_OF_ARRAY ||
ofeats & DAOS_OF_ARRAY_BYTE)
/** TODO - this should be GX when supported */
cid = OC_EC_2P2G1;
Copy link
Contributor

Choose a reason for hiding this comment

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

must it be 2P1 or 2P2? is it possible to select 4P2, 8P2, 16P2 in future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, i got those from @wangdi1
there are some that are not available today, and this is what was suggested as a reasonable default if not set by user.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, I mean P2 is the most popular. But I thought 4P2G1 might be most post popular choice generally. But I thought(heard) ANL might mostly use 8P2 or 16P2 for performance reason. Hmm, maybe domain_nr should be involved for consideration?
if domain_nr >=10
cid = 8P2G1
else if domain_rn >= 6
cid = 4P2G1
else
cid = 2P2G1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed that we probably need more correlation between the domain but also the target nr to set also the GX.
we can tackle this in a future PR when we add more EC object class?

Copy link
Contributor

@gnailzenh gnailzenh Mar 25, 2021

Choose a reason for hiding this comment

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

I've added all classes (commit 806d1cf), I assume we are not going to land it to 1.2, so we can switch to new classes in follow-on patch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we actually want to add to 1.2.
let me see what you added and adjust this PR i guess.

Copy link
Contributor Author

@mchaarawi mchaarawi Mar 25, 2021

Choose a reason for hiding this comment

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

ah wait.. i thought you were talking about my PR. but if we are not landing your PR to 1.2, then i can't change it here since we want to land this to 1.2.
i can do the change to master in a future PR to master. so if you are OK with this, please land it

break;
case DAOS_PROP_CO_REDUN_RF3:
case DAOS_PROP_CO_REDUN_RF4:
return -DER_INVAL;
Copy link
Contributor

Choose a reason for hiding this comment

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

RF3/RF4 is not supported temporarily, and may be supported later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is supported at the container level, but there is no oclass to support it today.. we need to add the oclass for it.
by default setting, this will not work today unless we create oclass to support it.

@mchaarawi mchaarawi requested a review from a team March 24, 2021 14:06
else if (rdd == DAOS_OCH_RDD_EC || ofeats & DAOS_OF_ARRAY ||
ofeats & DAOS_OF_ARRAY_BYTE)
/** TODO - this should be GX when supported */
cid = OC_EC_2P2G1;
Copy link
Contributor

@gnailzenh gnailzenh Mar 25, 2021

Choose a reason for hiding this comment

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

I've added all classes (commit 806d1cf), I assume we are not going to land it to 1.2, so we can switch to new classes in follow-on patch

@johannlombardi johannlombardi merged commit fba8d98 into master Mar 25, 2021
@johannlombardi johannlombardi deleted the mschaara/oclass_hints branch March 25, 2021 17:59
mchaarawi added a commit that referenced this pull request Mar 25, 2021
- choose oclass based on set redundancy and redundance factor of container.
- adjust oclass if shard sizing is indicated in hint, otherwise use
  max sharding.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
johannlombardi pushed a commit that referenced this pull request Mar 28, 2021
… (#5181)

- choose oclass based on set redundancy and redundance factor of container.
- adjust oclass if shard sizing is indicated in hint, otherwise use
  max sharding.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
@ashleypittman ashleypittman mentioned this pull request Apr 28, 2021
@ashleypittman ashleypittman mentioned this pull request May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants