-
Notifications
You must be signed in to change notification settings - Fork 306
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
Conversation
There was a problem hiding this 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.
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 |
afd0187
to
b5e2b50
Compare
There was a problem hiding this 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.
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 |
b5e2b50
to
8f0466b
Compare
There was a problem hiding this 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.
8f0466b
to
b53789e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style warning(s) for job https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-4831/4/
Please review https://wiki.hpdd.intel.com/display/DC/Coding+Rules
src/tests/suite/daos_obj.c
Outdated
oclass_auto_setting(void **state) | ||
{ | ||
test_arg_t *arg = *state; | ||
uuid_t uuid; |
There was a problem hiding this comment.
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
src/tests/suite/daos_obj.c
Outdated
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; |
There was a problem hiding this comment.
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
src/tests/suite/daos_obj.c
Outdated
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); |
There was a problem hiding this comment.
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
src/tests/suite/daos_obj.c
Outdated
|
||
print_message("OID settings with container RF0:\n"); | ||
/** create container with rf = 0 */ | ||
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC; |
There was a problem hiding this comment.
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
src/tests/suite/daos_obj.c
Outdated
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; |
There was a problem hiding this comment.
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
src/tests/suite/daos_obj.c
Outdated
oclass_auto_setting(void **state) | ||
{ | ||
test_arg_t *arg = *state; | ||
uuid_t uuid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uuid_t uuid; | |
uuid_t uuid; |
src/tests/suite/daos_obj.c
Outdated
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop = daos_prop_alloc(1); | |
prop = daos_prop_alloc(1); |
src/tests/suite/daos_obj.c
Outdated
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC; | ||
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
src/tests/suite/daos_obj.c
Outdated
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC; | ||
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
src/tests/suite/daos_obj.c
Outdated
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC; | ||
prop->dpp_entries[0].dpe_val = DAOS_PROP_CO_REDUN_RF2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
Test stage checkpatch completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-4831/4/execution/node/72/log |
b53789e
to
30bcd35
Compare
src/tests/suite/daos_obj.c
Outdated
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_int_equal(attr->u.ec.e_p, nr-1); | |
assert_int_equal(attr->u.ec.e_p, nr - 1); |
Test stage checkpatch completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-4831/5/execution/node/73/log |
src/tests/suite/daos_obj.c
Outdated
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_int_equal(attr->u.ec.e_p, nr-1); | |
assert_int_equal(attr->u.ec.e_p, nr - 1); |
Test stage checkpatch completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-4831/6/execution/node/72/log |
30bcd35
to
c4c635d
Compare
There was a problem hiding this 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>
c4c635d
to
6a0bd40
Compare
There was a problem hiding this 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.
src/include/daos_obj.h
Outdated
#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) |
There was a problem hiding this comment.
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_
There was a problem hiding this comment.
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..
src/object/obj_class.c
Outdated
return -DER_NOMEM; | ||
|
||
prop->dpp_entries[0].dpe_type = DAOS_PROP_CO_REDUN_FAC; | ||
rc = daos_cont_query(coh, NULL, prop, NULL); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
@wangdi1 @liuxuezhao @gnailzenh @johannlombardi |
switch (rf_factor) { | ||
case DAOS_PROP_CO_REDUN_RF0: | ||
if (rdd == DAOS_OCH_RDD_RP) | ||
cid = OC_RP_2GX; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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; |
There was a problem hiding this comment.
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
- 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>
… (#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>
max sharding.
Signed-off-by: Mohamad Chaarawi mohamad.chaarawi@intel.com