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

Duo Zhang updated HBASE-21375:
------------------------------
    Description: The problem for the old implementation is that we will only 
check the first procedure in a queue to see if it could run, if it can not, we 
will remove the queue from run queue. So when adding procedure to the 
scheduler, we have to try hard to put the procedure which can be executed in 
front of the queue, if there are corner cases where we fail to do so, it will 
likely lead to a dead lock, that's why we have the tricky code when loading 
procedures and try to add them into the scheduler, and also lots of 'if' in the 
doAdd method of MasterProcedureScheduler. But this is still not enough to make 
things right, so finally [~allan163] and I decided to change the logic in 
doPoll method, where we use a loop to find whether there is a procedure can be 
executed, not only the first one.  (was: The problem for the old implementation 
is that we will only check the first procedure in a queue to see if it could 
run, if it can not, we will remove the queue from run queue. So when adding 
procedure to the scheduler, we have to try hard to put the procedure which can 
be executed in front of the queue, if there are corner cases where we fail to 
do so, it will likely lead to a dead lock, that's why we have the tricky code 
here, and also lots of 'if' in the doAdd method of MasterProcedureScheduler. 
But this is still not enough to make things right, so finally [~allan163] and I 
decided to change the logic in doPoll method, where we use a loop to find 
whether there is a procedure can be executed, not only the first one.)

> Revisit the lock and queue implementation in MasterProcedureScheduler
> ---------------------------------------------------------------------
>
>                 Key: HBASE-21375
>                 URL: https://issues.apache.org/jira/browse/HBASE-21375
>             Project: HBase
>          Issue Type: Sub-task
>          Components: proc-v2
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>            Priority: Major
>             Fix For: 3.0.0, 2.2.0
>
>         Attachments: HBASE-21375-UT.patch, HBASE-21375-UT2.patch, 
> HBASE-21375-v1.patch, HBASE-21375-v2.patch, HBASE-21375.patch
>
>
> The problem for the old implementation is that we will only check the first 
> procedure in a queue to see if it could run, if it can not, we will remove 
> the queue from run queue. So when adding procedure to the scheduler, we have 
> to try hard to put the procedure which can be executed in front of the queue, 
> if there are corner cases where we fail to do so, it will likely lead to a 
> dead lock, that's why we have the tricky code when loading procedures and try 
> to add them into the scheduler, and also lots of 'if' in the doAdd method of 
> MasterProcedureScheduler. But this is still not enough to make things right, 
> so finally [~allan163] and I decided to change the logic in doPoll method, 
> where we use a loop to find whether there is a procedure can be executed, not 
> only the first one.



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

Reply via email to