-
Notifications
You must be signed in to change notification settings - Fork 304
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-30368 Add packagemap support for remoteStorage property #19148
HPCC-30368 Add packagemap support for remoteStorage property #19148
Conversation
Before moving out of draft, there are a few tasks to complete:
|
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-30368 Jirabot Action Result: |
@afishbeck My biggest questions are:
|
else | ||
remoteStorage.set(remoteLocation); | ||
file.resolveLocalOrRemote(locations, srcCluster, user, remoteStorage, remotePrefix, checkLocalFirst, expandSuperFiles ? &subfiles : NULL, trackSubFiles, resolveLFNForeign); | ||
remoteStorage.clear(); |
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.
Does the ability to clear this here mean that remoteStorage is a class member variable that is just being used here for temporary storage? Is that necessary?
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 will re-confirm that this is the case, but I recall that resolveLocalOrRemote
uses the class member variable for its work. But then I was concerned about side-effects since it wasn't previously set at this location. Perhaps it isn't necessary and should be a local temp.
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.
This wasn't correct and is adjusted in the next commit.
const char *defaultCluster, const char *baseCluster, const char *baseIP, const char *basePrefix, | ||
const char *currentRemoteStorage, StringBuffer& effectiveRemoteStorage, const char *baseRemoteStorage) | ||
{ | ||
if (!isEmptyString(address) && !isEmptyString(currentRemoteStorage)) |
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.
You're right that it shouldn't happen at the same level. I think you do support what Ananth wants which is to for example have the packagemap define a remoteStorage, but some packages inside it point to a daliIP?
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 believe it should support that case, but I need to confirm with a test.
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've tested behavior where a CLI setting of either daliip
or remote-storage
is overridden by either daliip
or remoteStorage
set in the packagemap file. Also, those properties defined in the file have a precedence over each other- a property defined in an element will override the value defined in its ancestors.
|
@ghalliday Finalizing is still pending on running a few tests. |
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 didn't see any logic flaws, but a couple of instances where the variable names are confusing.
{ | ||
StringBuffer ip; | ||
StringBuffer cluster; | ||
StringBuffer prefix; | ||
splitDerivedDfsLocation(superFile.queryProp("@daliip"), cluster, ip, prefix, NULL, _cluster, _ip, _prefix); | ||
StringBuffer remoteStorageName; |
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.
This is confusing having a variable remoteStorageName and _remoteStorageName. Can you rename one (or both) to clarify the difference.
Same applies to the next function.
@@ -126,13 +126,38 @@ void splitDerivedDfsLocation(const char *address, StringBuffer &cluster, StringB | |||
prefix.append(basePrefix); | |||
} | |||
|
|||
void splitDerivedDfsLocationOrRemote(const char *address, StringBuffer &cluster, StringBuffer &ip, StringBuffer &prefix, |
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 don't suggest it for this PR (or even as a priority), but this function has too many parameters, with little logical ordering - if it was refactored it would be good to think about which parameters should be grouped together, and possibly moved into a class.
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 didn't see any problems.
@afishbeckln please take another look
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.
Looks good to me.
@asselitx please squash. |
Similar to how the daliip property is supported in the packagemap file, add support for a remoteStorage property that mirrors the `--remote-storage` CLI option. - Apply the same scoping rules as for daliip- values defined deeper in the hierarchy take precedence, and anything defined in the file takes precedence over a CLI option. - Disallow use of both daliip and remoteStorage in the same element. Signed-off-by: Terrence Asselin <[email protected]>
c400b9b
to
a189286
Compare
Similar to how the daliip property is supported in the packagemap file, add support for a remoteStorage property that mirrors the
--remote-storage
CLI option.Type of change:
Checklist:
Smoketest:
Testing:
Manually ran seven tests on constellation of three clusters:
roxiecluster
that is the target of packagemap and query deployments, configured to copy files locally.thorcluster
configured as a remote storage location for the first.Each test verified that the nonlocal files were copied to local storage: