hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ayush Saxena (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-14661) RBF: updateMountTableEntry shouldn't update mountTableEntry if targetPath not exist
Date Tue, 23 Jul 2019 04:06:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-14661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16890660#comment-16890660
] 

Ayush Saxena commented on HDFS-14661:
-------------------------------------

I guess, we shouldn't stop from updating, we allow adding a mount entry too when the destination
is not available. We should just handle the quota exception and ignore, It is admin's discretion,
if he wants to create the destination directory after the mount entry. You can do same as
in HDFS-14331 i.e suppress any exception from Quota sync, while updating mount entry, Just
LOG it. For the test also you may use the existing one similarly add behind.

> RBF: updateMountTableEntry shouldn't update mountTableEntry if targetPath not exist
> -----------------------------------------------------------------------------------
>
>                 Key: HDFS-14661
>                 URL: https://issues.apache.org/jira/browse/HDFS-14661
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: rbf
>    Affects Versions: 3.1.2
>            Reporter: xuzq
>            Priority: Major
>         Attachments: HDFS-14661-HDFS-13891-001.patch, HDFS-14661-trunk-001.patch
>
>
> The updateMountTableEntry shouldn't update the mountEntry if the targetPath not exist.
> {code:java}
> @Override
> public UpdateMountTableEntryResponse updateMountTableEntry(
>     UpdateMountTableEntryRequest request) throws IOException {
>   UpdateMountTableEntryResponse response =
>       getMountTableStore().updateMountTableEntry(request);
>   MountTable mountTable = request.getEntry();
>   if (mountTable != null && router.isQuotaEnabled()) {
>     synchronizeQuota(mountTable.getSourcePath(),
>         mountTable.getQuota().getQuota(),
>         mountTable.getQuota().getSpaceQuota());
>   }
>   return response;
> }
> /**
>  * Synchronize the quota value across mount table and subclusters.
>  * @param path Source path in given mount table.
>  * @param nsQuota Name quota definition in given mount table.
>  * @param ssQuota Space quota definition in given mount table.
>  * @throws IOException
>  */
> private void synchronizeQuota(String path, long nsQuota, long ssQuota)
>     throws IOException {
>   if (router.isQuotaEnabled() &&
>       (nsQuota != HdfsConstants.QUOTA_DONT_SET
>       || ssQuota != HdfsConstants.QUOTA_DONT_SET)) {
>     HdfsFileStatus ret = this.router.getRpcServer().getFileInfo(path);
>     if (ret != null) {
>       this.router.getRpcServer().getQuotaModule().setQuota(path, nsQuota,
>           ssQuota, null);
>     }
>   }
> }
> {code}
> As above, updateMountTableEntry update one mountEntry:
>  # update mountEntry in zookeeper
>  # synchronizeQuota(maybe throw some exception like "Directory does not exist")
>  
> if  synchronizeQuota throw some exception, will return some exception to dfsRouterAdmin,
but the new mountEntry has been updated to zk.  
> It's clearly not what we would expect.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message