-
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-29721 setReplicateDir fails if config dir ends with path seperator #17974
HPCC-29721 setReplicateDir fails if config dir ends with path seperator #17974
Conversation
https://track.hpccsystems.com/browse/HPCC-29721 |
e4c9272
to
b226370
Compare
tmp.append(queryBaseDirectory(grp_unknown, 0, SepCharBaseOs(sc))); | ||
if (sc != tmp.charAt(tmp.length()-1)) | ||
tmp.append(sc); | ||
tmp.append(s); |
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.
NB: this is an incidental fix, observed while testing. A relative path and a config dir suffixed with a path separator caused a double path separator to be inserted.
I think this only ever happened (relative lfn dir path) via the unittests.
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.
A few comments/questions.
out.append(r).append(dir+i); | ||
return true; | ||
} | ||
} | ||
else if (count) { // this is a bit of a kludge to handle roxie backup |
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.
Did you mean to delete this code? If so the count/match variables are no longer needed.
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.
hm, I did not, well spotted.
if ((dir[i]==0)||isPathSepChar(dir[i])) { | ||
if (d[i]==0) | ||
{ | ||
if (dir[i]==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.
Worth adding a comment to clarify the cases. E.g.,
//directory is an exact match for the current base, so return replica unmodified.
dali/base/dafdesc.cpp
Outdated
return true; | ||
} | ||
else if (isPathSepChar(dir[i])) // should mean that the last char of d was not a pathsepchar | ||
{ | ||
out.append(r).append(dir+i); |
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 r definitely have no trailing /? Otherwise this could lead to double //
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.
that may be an additional issue. I'll check and probably add a check for tailing '/' on r too.
@ghalliday - please review changes - I thought I pushed this last week.. |
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, please squash
Causing unittest CDaliDFSStressTests testDFSRename failures. Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
6e42188
to
152d51f
Compare
@ghalliday - squashed. |
018eacd
into
hpcc-systems:candidate-9.0.x
Causing unittest CDaliDFSStressTests testDFSRename failures.
Type of change:
Checklist:
Smoketest:
Testing: