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

Dibyendu Karmakar commented on HDFS-13811:
------------------------------------------

Thanks [~linyiqun] for the review.

in *RouterQuotaManager.java*

I haven't change the existing logic for getQuotaUsage. I have added a check to 
verify the quota cache value for the requested mount entry, if the cache is 
null, it will try to refresh the cache for that mount entry only.

IMO, if we have quota entry for a path then first let us refresh the cache and 
return the value. If we cant find the quota after refreshing also, we will get 
the parent usage.

I think returning the null value to the user will be confusing for the user, 
its better to refresh the cache internally and return the value.

in *RouterQuotaUpdateService*
{quote}Line176: In quota update service, we don't really need to use parameter 
updateQuotaCache. Why not just set false. And no need to pass updateQuotaCache 
parameter.
{quote}
 If we don't use updateQuotaCache flag, from 
RouterQuotaUpdateService#periodicInvoke getQuotaSetMountTables will eventually 
call getQuotaUsage, which will again call periodicInvoke and it will go into an 
infinite loop. That's why updateQuotaCache flag is required.

Please let me know your thoughts, [~linyiqun]

Other comments I will handle in my next patch.

 

> RBF: Race condition between router admin quota update and periodic quota 
> update service
> ---------------------------------------------------------------------------------------
>
>                 Key: HDFS-13811
>                 URL: https://issues.apache.org/jira/browse/HDFS-13811
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Dibyendu Karmakar
>            Assignee: Dibyendu Karmakar
>            Priority: Major
>         Attachments: HDFS-13811-000.patch, HDFS-13811-HDFS-13891-000.patch
>
>
> If we try to update quota of an existing mount entry and at the same time 
> periodic quota update service is running on the same mount entry, it is 
> leading the mount table to _inconsistent state._
> Here transactions are:
> A - Quota update service is fetching mount table entries.
> B - Quota update service is updating the mount table with current usage.
> A' - User is trying to update quota using admin cmd.
> and the transaction sequence is [ A A' B ]
> quota update service is updating the mount table with old quota value.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to