Jinglun created HDFS-14964:
------------------------------

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


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: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to