[ 
https://issues.apache.org/jira/browse/HDFS-14964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jinglun updated HDFS-14964:
---------------------------
    Attachment: HDFS-14964-show-race-case.patch
        Status: Patch Available  (was: Open)

Upload HDFS-14964-show-race-case.patch showing the race case.

> Race between RouterUpdateService and RouterAdmin -setQuota
> ----------------------------------------------------------
>
>                 Key: HDFS-14964
>                 URL: https://issues.apache.org/jira/browse/HDFS-14964
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Jinglun
>            Assignee: Jinglun
>            Priority: Minor
>         Attachments: HDFS-14964-show-race-case.patch
>
>
> There is a race condition between RouterUpdateService and RouterAdmin 
> -setQuota. 
> Supposing the mount table is:
> M1: /dir-1              ns0:/dir-1 \{nsQuota, ssQuota}
>  # RouterUpdateService is scheduled. It finds the nsUsage of M1 is changed 
> and wants to update it at RouterQuotaUpdateService#147.
>  # Before RouterUpdateService updates, a RouterAdmin use -setQuota and update 
> the Mount Entry Quota.
>  # RouterAdmin -setQuota executes successfully and the quota is updated.
>  # RouterUpdateService is re-scheduled. It doesn't know the mount entry on zk 
> has already been updated. So it continue to update the quota usage and hence 
> overwrite RouterAdmin's change. 
>  
> I think a possible solution would be not letting RouterUpdateService to 
> update mount entry on zk(It will still update usage in cache). Let 
> RouterAdmin be the only entrance to update mount entry on zk. Even one Router 
> restarts the RouterUpdateService would compute and update the usage in cache 
> so not getting usage from zk won't be a big problem.
>  
> I wrote a unit test to show the race case. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to