From c4de7fff31d54208c6e6fae74ed688d4a6155088 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Thu, 26 Oct 2023 19:15:08 +0100 Subject: [PATCH] HPCC-30525 Fix issues of cased dropzone names mismatching group name Group names have always been treated as case-insensitive. Since 9.2 (HPCC-29553) groups have been created to match dropzones. This PR ensures that groups names created by dropzones are lowercased. This bug was causing environments with non-lowercased dropzone names to cause failures during sprays of the form: "DFUServer Error Failed: DFUWU: Logical group not found" Signed-off-by: Jake Smith --- dali/base/dadfs.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/dali/base/dadfs.cpp b/dali/base/dadfs.cpp index 3bd45dd497e..10ecce32320 100644 --- a/dali/base/dadfs.cpp +++ b/dali/base/dadfs.cpp @@ -10188,25 +10188,27 @@ class CInitGroups switch (groupType) { case grp_thor: - getClusterGroupName(cluster, gname); - if (!streq(cluster.queryProp("@name"), gname.str())) + getClusterGroupName(cluster, gname); // NB: ensures lowercases + if (!strieq(cluster.queryProp("@name"), gname.str())) realCluster = false; if (oldEnvCluster) { - getClusterGroupName(*oldEnvCluster, oldGname); - if (!streq(oldEnvCluster->queryProp("@name"), oldGname.str())) + getClusterGroupName(*oldEnvCluster, oldGname); // NB: ensures lowercases + if (!strieq(oldEnvCluster->queryProp("@name"), oldGname.str())) oldRealCluster = false; } break; case grp_thorspares: - getClusterSpareGroupName(cluster, gname); + getClusterSpareGroupName(cluster, gname); // ensures lowercase oldRealCluster = realCluster = false; break; case grp_roxie: gname.append(cluster.queryProp("@name")); + gname.toLowerCase(); break; case grp_dropzone: gname.append(cluster.queryProp("@name")); + gname.toLowerCase(); oldRealCluster = realCluster = false; defDir = cluster.queryProp("@directory"); break; @@ -10578,8 +10580,12 @@ class CInitGroups void ensureStorageGroup(bool force, const char * name, unsigned numDevices, const char * path, StringBuffer & messages) { - Owned newClusterGroup = createStorageGroup(name, numDevices, path); - ensureConsistentStorageGroup(force, name, newClusterGroup, messages); + //Lower case the group name - see CNamedGroupStore::dolookup which lower cases before resolving. + StringBuffer gname; + gname.append(name).toLowerCase(); + + Owned newClusterGroup = createStorageGroup(gname, numDevices, path); + ensureConsistentStorageGroup(force, gname, newClusterGroup, messages); } void constructStorageGroups(bool force, StringBuffer &messages) @@ -10618,7 +10624,7 @@ class CInitGroups } else if (plane.hasProp("hostGroup")) { - throw makeStringExceptionV(-1, "Use 'hosts' rather than 'hostGroup' for inline list of hosts for plane %s", name); + throw makeStringExceptionV(-1, "Use 'hosts' rather than 'hostGroup' for inline list of hosts for plane %s", gname.str()); } else if (plane.hasProp("hosts")) { @@ -10633,9 +10639,9 @@ class CInitGroups { //Locally mounted, or url accessed storage plane - no associated hosts, localhost used as a placeholder unsigned numDevices = plane.getPropInt("@numDevices", 1); - newClusterGroup.setown(createStorageGroup(name, numDevices, prefix)); + newClusterGroup.setown(createStorageGroup(gname, numDevices, prefix)); } - ensureConsistentStorageGroup(force, name, newClusterGroup, messages); + ensureConsistentStorageGroup(force, gname, newClusterGroup, messages); } } }