-
Notifications
You must be signed in to change notification settings - Fork 303
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
base: master
Are you sure you want to change the base?
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32724 Jirabot Action Result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look reasonable. Need to separate out the different types of changes though.
dali/base/dafdesc.cpp
Outdated
//printYAML(storage); | ||
// Add groups defined in environment.xml | ||
Owned<IPropertyTree> env = getHPCCEnvironment(); | ||
Owned<IPropertyTreeIterator> storagePlanes = env->getElements("Software/Globals/StoragePlaneList/StoragePlane[@name='*']"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor:I would use "Storage" (or "StoragePlanes" rather than "StoragePlaneList"
Also, no need to have a qualifier on the name:
Owned<IPropertyTreeIterator> storagePlanes = env->getElements("Software/Globals/StoragePlanes/StoragePlane");
I am not sure about the benefits of accessing via the environment, or by copying the data to the component configuration file and accessing from there.
@jakesmith opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard approach is to generate into the component config file (in this case daliconf.xml).
We do this already for other components (dfuserver, esp.. ), see e.g. initfiles/componentfiles/configxml/dfuserver.xsl. At the moment it does this for RemoteStorage only in those places.
should be generated in the same way into those configs too, and Dali (which doesn't need RemoteStorage) should generate only.
One caveat to that is that the above code only creates planes for existing groups in Dali (that correspond to engine groups in BM) if "planes" doesn't exist, but it will do after generating it into the config..
I suggest changing the createStoragePlane calls, so that in this context it adds a flag to the planes being added, to indicate they are based on groups (e.g. @fromGroup=true), and then change the start of this process to:
if (createPlanesFromGroups)
{
// delete all [@fromGroup=true] planes
// existing code that constructs groups and adds planes for groups
...
}
NB: this routine can be recalled if/when environment.xml changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied storage/planes definitions into component config files which allowed a group to be created for my storage plane.
I changed createStoragePlane to add the flag fromGroup to the planes created from it. Then at the beginning of the process changed it to remove all storage planes previously created by createStoragePlane by removing any with fromGroup=true. I also had to add a check at the beginning of createStoragePlanes for a storage plane that is already defined (this would be coming from the component config file) otherwise it would create a duplicate planes.
testing/regress/environment.xml.in
Outdated
@@ -20,6 +20,20 @@ | |||
storageWrites="0.0038"/> | |||
</Hardware> | |||
<Software> | |||
<Globals noCommon="true" | |||
maxConnections="-1"> | |||
<StoragePlane name="storagePlane" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't contain StoragePlaneList
Also, I suspect these should not be checked in as part of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed initfiles changes from PR.
@@ -459,12 +459,15 @@ AzureFile::AzureFile(const char *_azureFileName) : fullName(_azureFileName) | |||
|
|||
StringBuffer planeName(slash-filename, filename); | |||
Owned<IPropertyTree> plane = getStoragePlane(planeName); | |||
if (!plane) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to HPCC-32723 on my local repo.
const char * api = plane->queryProp("storageapi/@type"); | ||
if (!api) | ||
throw makeStringExceptionV(99, "No storage api defined for plane %s", planeName.str()); | ||
|
||
constexpr size_t lenPrefix = strlen(azureBlobPrefix); | ||
if ((strncmp(api, azureBlobPrefix, lenPrefix-1) != 0) || api[lenPrefix-1] != ':') | ||
if ((strncmp(api, azureBlobPrefix, lenPrefix-1) != 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the extra test should have been
api[lenPrefix-1] == 0
so that it doesn't match azureblobv2
possibly better would be to define a string without the trailing colon and use strieq.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use strieq.
@ghalliday I have removed changes unrelated to adding support for storage planes in bare-metal. The working code and the commits based on your comments can be found on branch HPCC-32723 in my forked repo. |
@jackdelv please convert to normal PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackdelv - please see comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackdelv - looks good. Please address 1 trivial comment and squash.
dali/base/dafdesc.cpp
Outdated
{ | ||
// Remove old planes created from groups | ||
while (storage->removeProp("planes[@fromGroup=\"1\"]")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial: for consistency match with true vs 1, and can use single quotes for readability:
while (storage->removeProp("planes[@fromGroup='true']"));
@jakesmith Squashed. I'm looking into why some of the smoketests are failing. |
- 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 <jack.delvecchio@lexisnexisrisk.com>
@jackdelv tests are still failing. Did Jakes suggestion of changing from ='1' to ='true' break it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests currently failing
@ghalliday It seems that may have been the issue. I will wait for the tests to run to be sure since I'm still confused why it was happening. When I run this code for connecting to my azure blob storage it seemed to be working on roxie. It was hitting an unimplemented error rather than the missing host group exception regardless of if '1' or 'true' is passed in.
I tested with testing/regress/payload.ecl and was getting the same host group error with 'true'. Changing to '1' seemed to fix the error.
Although, when the test suite reported the error, it was looking for myroxie, but I could only ever reproduce with the mythor host group. |
Type of change:
Checklist:
Smoketest:
Testing: