umamaheswararao edited a comment on pull request #2305:
URL: https://github.com/apache/hadoop/pull/2305#issuecomment-692781129
@ayushtkn Thanks a lot for the review!
>Just want to confirm, In rename, do we need to avoid any scenario like
HDFS-15444? Or that is guarded already.
I actually considered that case, the first time is without last component.
If that resolve result indicates it as InternalDir, then we are again resolving
with including lastComponent ( means with children ). In this case if it again
indicates internalDir or lastDirAsLink, then we are throwing exception as we
can not rename to any internal dir/link path.
```
InodeTree.ResolveResult<FileSystem> resDst =
fsState.resolve(getUriPath(dst), false);
if (resDst.isInternalDir() && fsState.getRootFallbackLink() != null) {
InodeTree.ResolveResult<FileSystem> resDstWithLastComp =
fsState.resolve(getUriPath(dst), true);
// resolveLastComponent with true is to check if the target already
// exist in internalDir/InternalDirLink itself.
if (resDstWithLastComp.isInternalDir() || resDstWithLastComp
.isLastInternalDirLink()) {
throw readOnlyMountTable("rename", dst);
```
There is one condition without fallback, we may attempt to rename. Probably
we need else, as we are combining if check with fsState.getRootFallbackLink()
!= null as well. I will update patch. Thanks
>Secondly, In resolve result, can we change the constructor directly?, or do
we need to have an overloaded constructor to avoid compatibility issues, that
might have saved couple of changes as well.
Currently the InodeTree interface audience is Private. I don't believe any
application holds class in separate jar. or serialize this class result to
remote service where they will use different jar. Let me know in case if it's
popping any potential compatibility breakage.
@InterfaceAudience.Private
@InterfaceStability.Unstable
abstract class InodeTree<T> {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]