Skip to content

Commit ef82b28

Browse files
authored
DAOS-18368 object: refine EC rotate enumeration minimum_nr and break condition (#17336) (#17347)
- For EC parity rotate, set minimum_nr to data_tgt_nr + 1 instead of all EC targets. This ensures that, even with some shard failures, at least one shard can return 2 keys (KDs). - Make the enumeration break condition stricter: only break if num < minimum_nr, not <=, to avoid premature termination when the buffer is exactly full. Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com> Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
1 parent 0775f50 commit ef82b28

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/object/srv_obj_migrate.c

Lines changed: 6 additions & 4 deletions
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
*/
@@ -2784,9 +2784,11 @@ migrate_one_epoch_object(daos_epoch_range_t *epr, struct migrate_pool_tls *tls,
27842784

27852785
if (daos_oclass_is_ec(&unpack_arg.oc_attr)) {
27862786
p_csum = NULL;
2787-
/* EC rotate needs to fetch from all shards */
2787+
/* EC rotate needs to fetch from all shards, at least with data_tgt_nr alive,
2788+
* at least one shard should get 2 KDs.
2789+
*/
27882790
if (obj_ec_parity_rotate_enabled_by_version(arg->oid.id_layout_ver))
2789-
minimum_nr = obj_ec_tgt_nr(&unpack_arg.oc_attr);
2791+
minimum_nr = obj_ec_data_tgt_nr(&unpack_arg.oc_attr) + 1;
27902792
else
27912793
minimum_nr = 2;
27922794
enum_flags |= DIOF_RECX_REVERSE;
@@ -2914,7 +2916,7 @@ migrate_one_epoch_object(daos_epoch_range_t *epr, struct migrate_pool_tls *tls,
29142916
}
29152917

29162918
/* Each object enumeration RPC will at least one OID */
2917-
if (num <= minimum_nr && (enum_flags & DIOF_TO_SPEC_GROUP)) {
2919+
if (num < minimum_nr && (enum_flags & DIOF_TO_SPEC_GROUP)) {
29182920
D_DEBUG(DB_REBUILD, "enumeration buffer %u empty"
29192921
DF_UOID"\n", num, DP_UOID(arg->oid));
29202922
break;

0 commit comments

Comments
 (0)