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-30570 Use default data plane if no destGroup req in FileSpray.Copy #18013

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

wangkx
Copy link
Member

@wangkx wangkx commented Nov 9, 2023

Use default data plane for remote/foreign copy if no destGroup req.

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:

Copy link

github-actions bot commented Nov 9, 2023

@wangkx wangkx requested a review from jakesmith November 9, 2023 20:15
{
getNodeGroupFromLFN(context, srcname, destNodeGroup);
if(isContainerized() && !isEmptyString(srcDali))
Copy link
Member

Choose a reason for hiding this comment

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

If dali specified performing a copy in containerized...
That should normally be forbidden, it is at least very unusual (implies containerized has been configured with allowForeign=true).

I don't think that was what @cloLN was testing when he hit the problem.
As you can see from the JIRA srcDali was blank (as you'd expect),
destGroup was also blank, and it's that that caused the problem.

I think the issue is that the file was ~remote, and getNodeGroupFromLFN isn't using wsdfs::lookup.
(anywhere that might lookup files from a remote source should now be using wsdfs::lookup)

@wangkx - can you check 'lookupLogicalName' in esp/smc/SMCLib/LogicFileWrapper.cpp, change to wsdfs::lookup and test ?

Copy link
Member Author

@wangkx wangkx Nov 15, 2023

Choose a reason for hiding this comment

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

@jakesmith I am adding the code to call the wsdfs::lookup if the srcname isRemote. I got the error "Remote storage 'test_remote_storage_name' not found". It is because, I think, I haven't set the remote storage 'test_remote_storage_name'. To test/debug, I am going to test the remote copy between HPCCs on my local Ubuntu VM and on my local Docker Desktop. Is it possible? How should I configure my environment.xml and my values.yaml to test the remote copy?

Copy link
Member

Choose a reason for hiding this comment

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

if the srcname isRemote.

you should not need the test. wsdfs::lookup, will fallback to legacy DFS if needed.

I think, I haven't set the remote storage 'test_remote_storage_name'.

you need to setup a definition on the bare-metal side.
See: https://track.hpccsystems.com/browse/HPCC-27688 (also, looking at the 160x setup may be helpful).

copy between HPCCs on my local Ubuntu VM and on my local Docker Desktop. Is it possible?

Yes, you can hit a local k8s hpcc running in DD.

Reach out to me on Teams if you need guidance.

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied the setup from 160x (will need your guidance on how to hit the local k8s later). I still got the same "Remote storage 'name' not found" error. In #16123, I saw the changes on several xsl files (no esp related?). Not sure that ESP can reach out the setup.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jakesmith when I tried to remote copy a file from my local DD to my local bare-metal VM, I got this error: 'Bare metal does not support remote file access to planes without hosts'. Is it possible to add the hosts to the DD planes?

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.

@wangkx - please see comment.

@wangkx wangkx requested a review from jakesmith November 20, 2023 22:36
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.

@wangkx - see reply.

@wangkx wangkx requested a review from jakesmith December 5, 2023 22:20
@@ -107,7 +108,7 @@ IDistributedFile* lookupLogicalName(IEspContext& context, const char* logicalNam
userDesc->set(userID, context.queryPassword(), context.querySignature());
}

Owned<IDistributedFile> df = queryDistributedFileDirectory().lookup(logicalName, userDesc, accessMode,
Owned<IDistributedFile> df = wsdfs::lookup(logicalName, userDesc, accessMode,
Copy link
Member

Choose a reason for hiding this comment

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

@wangkx - is this change directly related to the issue that's being fixed?
i.e. is this lookupLogicalName used in the context of a copy from a remote file ? (I'm not sure I see where from CFileSprayEx::onCopy)

Copy link
Member Author

Choose a reason for hiding this comment

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

May not be related to this issue. I changed it because of your comment in #18013 (comment), and because it is called by CFileSprayEx::onCopy through the getNodeGroupFromLFN(). If you want, I can change it back.

Copy link
Member

Choose a reason for hiding this comment

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

right, if it had to call getNodeGroupFromLFN .. then wouldn't work unless it was using wsdfs::, but as discussed it doesn't make sense for getNodeGroupFromLFN to be used in the context of a out of environment logical file, at least not for this purpose.

I think it better that this change be removed from this PR, but it probably does make sense as part of a separate change. Anything that might be used to lookup a remote file should use wsdfs, please open a separate JIRA.

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.

@wangkx - see question.

@wangkx
Copy link
Member Author

wangkx commented Dec 7, 2023

@jakesmith the changes related to the wsdfs::lookup call have been removed. I created https://track.hpccsystems.com/browse/HPCC-30985.
I also noticed that the getDefaultStoragePlane() does not return a plane for bare metal.

@wangkx wangkx requested a review from jakesmith December 7, 2023 19:16
if(!isEmptyString(srcDali) || lfn.isForeign() || lfn.isRemote())
{
//makes no sense to get the srcname's current group, if a logical file is from a different environment.
getDefaultStoragePlane(destNodeGroup);
Copy link
Member

Choose a reason for hiding this comment

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

I also noticed that the getDefaultStoragePlane() does not return a plane for bare metal.

In that case, yes, there is only the concept of a default plane in containerized...
This should not call it in bare-metal.
But that means, in bare-metal if no destNodeGroup is supplied - it should fire an error - there is no sensible default.
We could consider allowing a default to be defined in bare-metal to be more consistent, for such times, but I'm not sure it's worth it.

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.

@wangkx - see comment re. no default , should fire an error in bare-metal.

@wangkx wangkx requested a review from jakesmith December 11, 2023 14:00
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.

@wangkx - looks good. Please squash.

const char* destNodeGroupReq = req.getDestGroup();
if(!destNodeGroupReq || !*destNodeGroupReq)
if(isEmptyString(destNodeGroupReq))
Copy link
Member

Choose a reason for hiding this comment

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

picky: there was probably a mix before, but worth making formatting consistent within a function you're modifying, e.g. missing space after if here and on new code on line 2700.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do

Use default data plane for remote/foreign copy if no destGroup req

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
@wangkx
Copy link
Member Author

wangkx commented Dec 12, 2023

Squashed. Rebased. Tested.
@ghalliday this PR is ready to be merged.

@ghalliday ghalliday merged commit caf7a15 into hpcc-systems:candidate-9.4.x Dec 14, 2023
45 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
Development

Successfully merging this pull request may close these issues.

3 participants