Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32724 Allow storage planes to be defined in bare-metal systems #19234

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future PR it might be interesting to allow some attributes for the implicit storage planes to be set in the configuration - so merge the definitions. For example to be able to set expert options on thor storage planes, even if only for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and have opened this JIRA.

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']"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor style: For loops with empty bodies it is clearer to code as the following:

while (storage->removeProp("planes[@fromGroup='1']"))
{
}

because it makes it clear that the body is intentionally blank. No need to change for this PR since it matches other examples.

Although having said that there should be a function that avoids the need for the loop. @jakesmith Added HPCC-33048.

storage->removeProp("hostGroups"); // generateHosts will recreate host groups for all planes

GroupInfoArray allGroups;
unsigned numDropZones = 0;

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

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
Loading