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

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

Thanks [~linyiqun] for the review.

Here I am taking the following approach-

Updating the quota in state store is an admin call, If we try to update 
statestore internally by periodic service it will lead to race condition.

IMO we should not update the mount table statestore internally, only the admin 
call should be able to update mount table statestore.

In this patch I am restricting the periodic service to update mount table state 
store. Periodic service will only update the quota usage and store it in local 
cache. So, whenever the get call will come it will fetch all the other details 
from satestore and quota usage will be fetched from the cache. During get call 
if we get null value from cache, for quota usage then also we are trying to 
update the usage once, for that specific mount entry.

Though there is a bit code change but I think it will keep the functionality 
clean.

Please let me know your thoughts [~linyiqun].

 

> 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
>
>
> 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