[ https://issues.apache.org/jira/browse/HBASE-5494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268042#comment-13268042 ]
Alex Feinberg commented on HBASE-5494: -------------------------------------- Re: "One thing we'd like to prevent is a table being disabled while splits (or merges) are going on. How hard would it be to add this facility (in another jira?). One way of doing it would be that a regionserver before splitting, it'd take out the table lock. That woul prevent the table from being disabled. But what about the case if two regionservers try to split a region from the same table at the one time? Or, what if the regionserver dies mid-split; the lock will be stuck in place." This is an interesting question. I think one approach may be to create a region level lock manager, and to convert the table-level lock manager to support read-write locks. Schema modifications (create/disable/alter/delete/) would acquire a table-wide read lock (as now). For splits and merges, region servers would acquire a table wide _read lock_ (to allow two regionserves to split differnet regions of a table at the same time, but prevent schema modifications during a split/merge), and a write lock (i.e., a usual lock) over the regions that are being split (I'm not even sure if this step is even needed at this point). We also need a way to handle stuck locks (currently DistributedLock uses persistent ZNodes) after crashes with minimal (if any) manual intervention (key thing being that whatever schema-modification was started prior to the crash is safely rolled back -- which may be non-trivial, as I would guess it would more complex than just keeping a txn id in the log and then reading through the HLog for META). > Introduce a zk hosted table-wide read/write lock so only one table operation > at a time > -------------------------------------------------------------------------------------- > > Key: HBASE-5494 > URL: https://issues.apache.org/jira/browse/HBASE-5494 > Project: HBase > Issue Type: Improvement > Reporter: stack > Attachments: D2997.3.patch, D2997.4.patch > > > I saw this facility over in the accumulo code base. > Currently we just try to sort out the mess when splits come in during an > online schema edit; somehow we figure we can figure all possible region > transition combinations and make the right call. > We could try and narrow the number of combinations by taking out a zk table > lock when doing table operations. > For example, on split or merge, we could take a read-only lock meaning the > table can't be disabled while these are running. > We could then take a write only lock if we want to ensure the table doesn't > change while disabling or enabling process is happening. > Shouldn't be too hard to add. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira