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-27843 CLI support for specifying remote storage instead of DALI #17813

Merged

Conversation

afishbeck
Copy link
Member

@afishbeck afishbeck commented Sep 25, 2023

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@github-actions
Copy link

@afishbeck afishbeck changed the title HPCC-28373 CLI support for specifying remote storage instead of DALI HPCC-27843 CLI support for specifying remote storage instead of DALI Sep 25, 2023
@afishbeck
Copy link
Member Author

@ghalliday @jakesmith this change is intended only to replace usage of remote DALI with DFS (via a remote storage definition). It's not a reinvention of how data gets onto roxie on the cloud. That is something we may want to discuss at the offsite.

Also note, this is step 1, getting the file meta-data or DFU workunits in place.

Roxie actually copying from remote needs testing once this is in place.
And there is a JIRA open about dfuserver handling remote copies: https://track.hpccsystems.com/browse/HPCC-29694

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

@afishbeck looks good. A couple of items of debug tracing left in. Jake needs to check the logic, I was mainly looking for flaws in the code.

if (tree)
{
processRemoteFileTree(tree, srcCluster, subfiles);
DBGLOG("RemoteDALI xml");
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it should be removed...

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, removed.

if (tree)
{
remoteStorage.set(remoteStorageName);
DBGLOG("RemoteStorage xml");
Copy link
Member

Choose a reason for hiding this comment

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

Also, should be deleted?

else
resolveLocal(locations, srcCluster, user, subfiles);
}

void ReferencedFile::resolve(const char *dstCluster, const char *srcCluster, IUserDescriptor *user, INode *remote, const char *remotePrefix, bool checkLocalFirst, StringArray *subfiles, bool _trackSubFiles, bool resolveForeign)
/*
Copy link
Member

Choose a reason for hiding this comment

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

Should now be removed?

Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@afishbeck - looks sensible overall, some minor comments/questions.

StringAttrBuilder logicalNameText(logicalName), daliipText(daliip);
logicalNameText.set(skipForeign(lfn, &daliipText)).toLowerCase();
StringAttrBuilder logicalNameText(logicalName), daliipText(daliip), remoteStorageText(remoteStorage);
logicalNameText.set(skipForeignOrRemote(lfn, &daliipText, &remoteStorageText)).toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

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

probably not for now, but it feels like checkForeign/skipNextLfnScope/skipForeignOrRemote should be either using similar functionality already in CDfsLogicalFileName, or for these logical file helpers to be commoned up and moved there.


virtual bool needsCopying(bool cloneForeign) const override;

virtual const char *getLogicalName() const {return logicalName.str();}
virtual unsigned getFlags() const {return flags;}
virtual const SocketEndpoint &getForeignIP(SocketEndpoint &ep) const
{
if ((flags & RefFileForeign) && daliip.length())
if ((flags & RefFileLFNForeign) && daliip.length())
Copy link
Member

Choose a reason for hiding this comment

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

maybe not new, code implies RefFileLFNForeign flag can be set and daliip empty, is that possible?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right it doesn't look possible. I would like to clean this up, but since it's existing (overly defensive code) I would prefer to do it separately from adding this new feature.

common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
dali/dfu/dfuutil.cpp Outdated Show resolved Hide resolved
if (tree)
ftree.setown(tree->getPropTree("File"));
if (!ftree.get())
throw MakeStringException(-1,"Source file %s could not be found in Remote Storage", remoteLFN.str()); //remote scope already included in remoteLFN
Copy link
Member

Choose a reason for hiding this comment

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

should use makeStringExceptionV

Copy link
Member

Choose a reason for hiding this comment

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

now we have a exceptionHandler mechansim (and it's always been a good idea, we're just lazy ;)) - it would be good to add meaningful error codes (based on ranges in errrorlist.h)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. It might make sense to do all of dfuutil.cpp at once.

I've created a jira: https://track.hpccsystems.com/browse/HPCC-30410

dali/dfu/dfuutil.cpp Outdated Show resolved Hide resolved
Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@afishbeck - looks good, a couple of trivial comments + 1 question - but could be merged now after squashing afaics.

common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
common/pkgfiles/referencedfilelist.cpp Outdated Show resolved Hide resolved
Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

Changes following my comments look good

@ghalliday
Copy link
Member

@afishbeck the build failure looks like it may be related.

@afishbeck
Copy link
Member Author

@jakesmith @ghalliday I did some trivial fixes based on Jake's comments and added the expert config section to ESP. I'll squash after tomorrow mornings meeting with Gavin.
Unfortunately I did things in the wrong order and will now have to wait to look at any build test errors til after the current run.

@jakesmith
Copy link
Member

@afishbeck - looks good to squash, passes tests bar the docker 'no space left on device' issue.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
@ghalliday ghalliday merged commit b73ac78 into hpcc-systems:candidate-9.4.x Oct 4, 2023
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants