From a70dfcb96b8a1dfcef99b696b64815a412717cab Mon Sep 17 00:00:00 2001 From: Jack Del Vecchio Date: Fri, 25 Oct 2024 10:08:01 -0400 Subject: [PATCH] HPCC-32724 Allow storage planes to be defined in bare-metal systems - Copy any storage plane definitions from environment.xml Globals into component config files - Change createStoragePlane to exit if the storage plane already exists (this is after any previous storage planes created with createStoragePlane are removed) - Add fromGroup=true flag to storage planes created from groups Signed-off-by: Jack Del Vecchio --- dali/base/dafdesc.cpp | 14 ++++++++++++-- .../componentfiles/configxml/RoxieTopology.xsl | 1 + initfiles/componentfiles/configxml/agentexec.xsl | 1 + initfiles/componentfiles/configxml/dali.xsl | 1 + initfiles/componentfiles/configxml/dfuserver.xsl | 1 + initfiles/componentfiles/configxml/esp.xsl | 1 + initfiles/componentfiles/configxml/thor.xsl | 3 ++- 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/dali/base/dafdesc.cpp b/dali/base/dafdesc.cpp index 7a811d589d6..4b5484463c7 100644 --- a/dali/base/dafdesc.cpp +++ b/dali/base/dafdesc.cpp @@ -3498,6 +3498,11 @@ bool GroupInformation::checkIsSubset(const GroupInformation & other) void GroupInformation::createStoragePlane(IPropertyTree * storage, unsigned copy) const { + // Check that storage plane does not already have a definition + VStringBuffer xpath("planes[@name='%s']", name.str()); + if (storage->hasProp(xpath)) + return; + IPropertyTree * plane = storage->addPropTree("planes"); StringBuffer mirrorname; const char * planeName = name; @@ -3539,6 +3544,8 @@ void GroupInformation::createStoragePlane(IPropertyTree * storage, unsigned copy const char * category = (dropZoneIndex != 0) ? "lz" : "data"; plane->setProp("@category", category); + plane->setPropBool("@fromGroup", true); + //MORE: If container is identical to this except for the name we could generate an information tag @alias } @@ -3652,8 +3659,12 @@ static void doInitializeStorageGroups(bool createPlanesFromGroups) storage.set(globalConfig->addPropTree("storage")); #ifndef _CONTAINERIZED - if (createPlanesFromGroups && !storage->hasProp("planes")) + if (createPlanesFromGroups) { + // Remove old planes created from groups + while (storage->removeProp("planes[@fromGroup='1']")); + storage->removeProp("hostGroups"); // generateHosts will recreate host groups for all planes + GroupInfoArray allGroups; unsigned numDropZones = 0; @@ -3705,7 +3716,6 @@ static void doInitializeStorageGroups(bool createPlanesFromGroups) } #endif - //Ensure that host groups that are defined in terms of other host groups are expanded out so they have an explicit list of hosts normalizeHostGroups(); diff --git a/initfiles/componentfiles/configxml/RoxieTopology.xsl b/initfiles/componentfiles/configxml/RoxieTopology.xsl index 96e584b6b0e..2b896e0a078 100644 --- a/initfiles/componentfiles/configxml/RoxieTopology.xsl +++ b/initfiles/componentfiles/configxml/RoxieTopology.xsl @@ -137,6 +137,7 @@ + diff --git a/initfiles/componentfiles/configxml/agentexec.xsl b/initfiles/componentfiles/configxml/agentexec.xsl index 182e503e021..7a6166387a1 100644 --- a/initfiles/componentfiles/configxml/agentexec.xsl +++ b/initfiles/componentfiles/configxml/agentexec.xsl @@ -137,6 +137,7 @@ + diff --git a/initfiles/componentfiles/configxml/dali.xsl b/initfiles/componentfiles/configxml/dali.xsl index b751bf3c863..85f316fbf6e 100644 --- a/initfiles/componentfiles/configxml/dali.xsl +++ b/initfiles/componentfiles/configxml/dali.xsl @@ -120,6 +120,7 @@ + diff --git a/initfiles/componentfiles/configxml/dfuserver.xsl b/initfiles/componentfiles/configxml/dfuserver.xsl index fb5c607731a..c4db09ddc88 100644 --- a/initfiles/componentfiles/configxml/dfuserver.xsl +++ b/initfiles/componentfiles/configxml/dfuserver.xsl @@ -100,6 +100,7 @@ + diff --git a/initfiles/componentfiles/configxml/esp.xsl b/initfiles/componentfiles/configxml/esp.xsl index 8fca1a45b39..8287a3e6bb4 100644 --- a/initfiles/componentfiles/configxml/esp.xsl +++ b/initfiles/componentfiles/configxml/esp.xsl @@ -76,6 +76,7 @@ + diff --git a/initfiles/componentfiles/configxml/thor.xsl b/initfiles/componentfiles/configxml/thor.xsl index 4e2a3527889..1107c25802e 100644 --- a/initfiles/componentfiles/configxml/thor.xsl +++ b/initfiles/componentfiles/configxml/thor.xsl @@ -205,7 +205,8 @@ --> - + +