Skip to content

Commit a0b9e30

Browse files
committed
DAOS-17973 control: Allow none for pool property self_heal (#16848)
It is impossible to turn off all flags of pool property self_heal, because dmg pool set-prop disallows empty value syntax. This patch adds "none" as a valid value for pool property self_heal, to indicate that all flags are turned off. Signed-off-by: Li Wei <[email protected]>
1 parent 608598a commit a0b9e30

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/control/cmd/dmg/pool_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// (C) Copyright 2019-2024 Intel Corporation.
3-
// (C) Copyright 2025 Hewlett Packard Enterprise Development LP
3+
// (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
44
//
55
// SPDX-License-Identifier: BSD-2-Clause-Patent
66
//
@@ -771,6 +771,20 @@ func TestPoolCommands(t *testing.T) {
771771
}, " "),
772772
nil,
773773
},
774+
{
775+
"Set pool properties with self_heal value 'none'",
776+
`pool set-prop 031bcaf8-f0f5-42ef-b3c5-ee048676dceb self_heal:none,space_rb:42`,
777+
strings.Join([]string{
778+
printRequest(t, &control.PoolSetPropReq{
779+
ID: "031bcaf8-f0f5-42ef-b3c5-ee048676dceb",
780+
Properties: []*daos.PoolProperty{
781+
propWithVal("self_heal", "none"),
782+
propWithVal("space_rb", "42"),
783+
},
784+
}),
785+
}, " "),
786+
nil,
787+
},
774788
{
775789
"Set pool properties with pool flag",
776790
"pool set-prop 031bcaf8-f0f5-42ef-b3c5-ee048676dceb label:foo,space_rb:42",

src/control/lib/daos/pool_property.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// (C) Copyright 2021-2023 Intel Corporation.
3-
// (C) Copyright 2025 Hewlett Packard Enterprise Development LP
3+
// (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
44
//
55
// SPDX-License-Identifier: BSD-2-Clause-Patent
66
//
@@ -53,6 +53,8 @@ func PoolProperties() PoolPropertyMap {
5353
return "not set"
5454
}
5555
switch n {
56+
case 0:
57+
return "none"
5658
case PoolSelfHealingAutoExclude:
5759
return "exclude"
5860
case PoolSelfHealingAutoRebuild:
@@ -69,6 +71,7 @@ func PoolProperties() PoolPropertyMap {
6971
},
7072
},
7173
values: map[string]uint64{
74+
"none": 0,
7275
"exclude": PoolSelfHealingAutoExclude,
7376
"rebuild": PoolSelfHealingAutoRebuild,
7477
"delay_rebuild": PoolSelfHealingDelayRebuild,

src/tests/suite/daos_pool.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* (C) Copyright 2016-2023 Intel Corporation.
3+
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
34
*
45
* SPDX-License-Identifier: BSD-2-Clause-Patent
56
*/
@@ -735,7 +736,7 @@ pool_op_retry(void **state)
735736
/* pool set prop success committed, "lost" reply - duplicate RPC retry */
736737
test_set_engine_fail_loc(arg, leader_rank, DAOS_MD_OP_PASS_NOREPLY | DAOS_FAIL_ONCE);
737738
print_message("set pool prop (retry / dup rpc detection)... ");
738-
rc = daos_pool_set_prop(arg->pool.pool_uuid, "self_heal", "rebuild");
739+
rc = daos_pool_set_prop(arg->pool.pool_uuid, "self_heal", "none");
739740
assert_rc_equal(rc, 0);
740741
print_message("success\n");
741742

0 commit comments

Comments
 (0)