From c564d3e95ae10ae071be54d2ca3b0dba51c68bb8 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 19 Oct 2026 02:47:06 -0700 Subject: [PATCH] shell: do not flag ec-only volumes as duplicates An ec-only volume has no regular copy, so its shard collections had nothing to compare against and always read as foreign. --- weed/shell/command_volume_check_duplicate_ids.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/weed/shell/command_volume_check_duplicate_ids.go b/weed/shell/command_volume_check_duplicate_ids.go index a9ee22ee76..7a03df3628 100644 --- a/weed/shell/command_volume_check_duplicate_ids.go +++ b/weed/shell/command_volume_check_duplicate_ids.go @@ -96,9 +96,11 @@ func (c *commandVolumeCheckDuplicateIds) Do(args []string, commandEnv *CommandEn layouts := seen[vid] shardLayouts := ecSeen[vid] ecForeign := false - for collection := range ecCollections[vid] { - if !collections[vid][collection] { - ecForeign = true + if len(collections[vid]) > 0 { + for collection := range ecCollections[vid] { + if !collections[vid][collection] { + ecForeign = true + } } } if len(layouts) < 2 && len(shardLayouts) < 2 && !ecForeign {