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

stack commented on HBASE-20828:
-------------------------------

More:

Currently Master does not run the cluster shutdown -- i.e. close of regions -- 
but rather RS notice the cluster shutdown and do their own closing. The Master 
gets notice of CLOSE but since it did not initiate the CLOSE, it complains it 
knows nothing about the Procedure and then just ignores it. Confusing to an 
operator.

And this stuff from HBASE-20846 needs adding...

1. Make hasLock method final, and add a locked field in Procedure to record 
whether we have the lock. We will set it to true in doAcquireLock and to false 
in doReleaseLock. The sub procedures do not need to manage it any more.

2. Also added a locked field in the proto message. When storing, the field will 
be set according to the return value of hasLock. And when loading, there is a 
new field in Procedure called lockedWhenLoading. We will set it to true if the 
locked field in proto message is true.

3. The reason why we can not set the locked field directly to true by calling 
doAcquireLock is that, during initialization, most procedures need to wait 
until master is initialized. So the solution here is that, we introduced a new 
method called waitInitialized in Procedure, and move the wait master 
initialized related code from acquireLock to this method. And we added a 
restoreLock method to Procedure, if lockedWhenLoading is true, we will call the 
acquireLock to get the lock, but do not set locked to true. And later when we 
call doAcquireLock and pass the waitInitialized check, we will test 
lockedWhenLoading, if it is true, when we just set the locked field to true and 
return, without actually calling the acquireLock method since we have already 
called it once.



> Finish-up AMv2 Design/List of Tenets/Specification of operation
> ---------------------------------------------------------------
>
>                 Key: HBASE-20828
>                 URL: https://issues.apache.org/jira/browse/HBASE-20828
>             Project: HBase
>          Issue Type: Umbrella
>          Components: amv2
>            Reporter: stack
>            Priority: Major
>
> AMv2 is missing specification. There are too many grey-areas still. Also 
> missing are a concise listing of the tenets of AMv2 operation. Here are some 
> examples:
>  * HBASE-19529 "Handle null states in AM": Asks how we should treat null 
> state in hbase:meta. What does it 'mean'. We seem to treat it differently 
> dependent on context. Needs clarification. [~Apache9] recently asked similar 
> about the meaning of OFFLINE.
>  * Logging needs to have a particular form to help trace Procedure progress; 
> needs a write-up.
> Lets fill in items to address in this umbrella issue. Can address in 
> subissues and produce specification doc too. We have the below but these are 
> mostly (incomplete) description for devs on pv2 and amv2; the specification 
> is missing:
> http://hbase.apache.org/book.html#pv2
> http://hbase.apache.org/book.html#amv2
> (Other areas include addressing what is up w/ rollback -- when, how much, and 
> when it is not appropriate -- as well as recommendation on Procedures 
> coarseness, locking -- is it ok to lock table in alter table procedure for 
> the life of the procedure? -- and so on).



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

Reply via email to