Skip to content

Commit

Permalink
HPCC-32724 Allow storage planes to be defined in bare-metal systems
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
jackdelv committed Nov 12, 2024
1 parent 9ab6ad9 commit 264a352
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
26 changes: 14 additions & 12 deletions dali/base/dafdesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -3699,19 +3710,10 @@ static void doInitializeStorageGroups(bool createPlanesFromGroups)
if (cur.groupType == grp_thor)
cur.createStoragePlane(storage, 1);
}
}

// Add storage planes defined in environment.xml
Owned<IPropertyTree> env = getHPCCEnvironment();
Owned<IPropertyTreeIterator> storagePlanes = env->getElements("Software/Globals/Storage/StoragePlane");
ForEach(*storagePlanes)
{
IPropertyTree & storagePlane = storagePlanes->query();
storage->addPropTree("planes", LINK(&storagePlane));
//Uncomment the following to trace the values that been generated
//printYAML(storage);
}

//Uncomment the following to trace the values that been generated
//printYAML(storage);
#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
Expand Down
1 change: 1 addition & 0 deletions initfiles/componentfiles/configxml/RoxieTopology.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<global>
<storage>
<xsl:copy-of select="/Environment/Software/RemoteStorage/*"/>
<xsl:copy-of select="/Environment/Software/Globals/storage/*"/>
</storage>
<expert>
<xsl:copy-of select="/Environment/Software/Globals/@* | /Environment/Software/Globals/*"/>
Expand Down
1 change: 1 addition & 0 deletions initfiles/componentfiles/configxml/agentexec.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<global>
<storage>
<xsl:copy-of select="/Environment/Software/RemoteStorage/*"/>
<xsl:copy-of select="/Environment/Software/Globals/storage/*"/>
</storage>
<expert>
<xsl:copy-of select="/Environment/Software/Globals/@* | /Environment/Software/Globals/*"/>
Expand Down
1 change: 1 addition & 0 deletions initfiles/componentfiles/configxml/dali.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<xsl:copy-of select="/Environment/Software/Globals/@* | /Environment/Software/Globals/*"/>
</expert>
<xsl:copy-of select="/Environment/Hardware/cost"/>
<xsl:copy-of select="/Environment/Software/Globals/storage"/>
</global>
<xsl:if test="@authMethod='secmgrPlugin'">
<SecurityManagers>
Expand Down
1 change: 1 addition & 0 deletions initfiles/componentfiles/configxml/dfuserver.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<global>
<storage>
<xsl:copy-of select="/Environment/Software/RemoteStorage/*"/>
<xsl:copy-of select="/Environment/Software/Globals/storage/*"/>
</storage>
<expert>
<xsl:copy-of select="/Environment/Software/Globals/@* | /Environment/Software/Globals/*"/>
Expand Down
1 change: 1 addition & 0 deletions initfiles/componentfiles/configxml/esp.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
</expert>
<storage>
<xsl:copy-of select="/Environment/Software/RemoteStorage/*"/>
<xsl:copy-of select="/Environment/Software/Globals/storage/*"/>
</storage>
<xsl:copy-of select="/Environment/Hardware/cost"/>
<xsl:copy-of select="/Environment/Software/tracing"/>
Expand Down
3 changes: 2 additions & 1 deletion initfiles/componentfiles/configxml/thor.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@
-->
<global>
<storage>
<xsl:copy-of select="/Environment/Software/RemoteStorage/*"/>
<xsl:copy-of select="/Environment/Software/RemoteStorage/*"/>
<xsl:copy-of select="/Environment/Software/Globals/storage/*"/>
</storage>
<expert>
<xsl:copy-of select="/Environment/Software/Globals/@* | /Environment/Software/Globals/*"/>
Expand Down

0 comments on commit 264a352

Please sign in to comment.