hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@duboce.net
Subject Re: Review Request: hbase-3112 Enable and disable of table needs a bit of loving in new master
Date Tue, 09 Nov 2010 00:05:05 GMT

> On 2010-11-08 12:13:11, Jonathan Gray wrote:
> > Looks pretty good.  Should be much improved.
> > 
> > What about client-side semantics and checks?  I thought there was going to be some
change there?  An async trigger and then a fast way to see if it's done or not?  Should be
clear on javadoc since enable/disable is always thing we get questions on.
> > 
> > I think most of my issues with patch is that it adds huge amount of new code into
already big AssignmentManager class.  Should move these classes out and not sure if we should
have these methods which just touch ZK.  I think having all logic about the state transitions,
usage of ZK, etc more explicitly controlled in the handlers themselves might be more clear
to follow how this works.  Maybe not but was a little hard to follow (that, for example, we
don't have enabling/disabling states in memory... where we were talking about in-memory state
vs zk states, etc).
> > 
> > Also, ZKTable can be simplified (and made more future proof) with an enum.
> > 
> > Now, for failover, I know we said we would punt to 0.92 on handling of this case,
but we should at least make it so we don't get into broken state if we have a master failover.
 What will happen if we are in disabling up in zk but not all closes have been done?
> > 
> > Lastly... I think we definitely need some unit tests on this stuff.  TestMasterFailover
does a little but not really relevant to these changes (only deals with regions already RIT).
 TestRollingRestart does an enable/disable of table.  But none of this stuff takes into account
failure of stuff in handlers, failure of RS, etc... Don't need to hold up this patch on unit
tests if it's working in cluster testing on large tables, but it's kind of thing that would
be good to test at some point.

Added to shell is_enabled and is_disabled.  Added javadoc to enableTable and disableTable
explaining how these methods return immediately now but that process can take a while to complete.

On methods that just touch zk, they are of a class of which one member -- isTableDisabled
-- does checks of AM data structures... so I can't really move them out.

Change ZKTable to use enums.

If disabling and master failover, when new master comes online, will be broke. But enable/disable
are idempotent and a rerun of enable/disable will start up the process again and it should
finish off properly.  Thats the theory anyways.

Regards unit tests, enable/disable is used all over unit test code base.  If you are looking
for a test that simulates big table enable/disable, that's hard to do in a unit test.

> On 2010-11-08 12:13:11, Jonathan Gray wrote:
> > trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java, line
> > <http://review.cloudera.org/r/1187/diff/2/?file=16884#file16884line1302>
> >
> >     I thought we had this method somewhere already?

there is a similarly named one for zk that you added -- is that what you are referring to?

> On 2010-11-08 12:13:11, Jonathan Gray wrote:
> > trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java, line
> > <http://review.cloudera.org/r/1187/diff/2/?file=16884#file16884line1573>
> >
> >     Are these methods necessary?  Seems like unnecessary stuff in AssignmentManager.
 The Handlers can just use the ZK methods directly?  (keep the AM methods as check/set of
it's internal state?)

See note above where argument is that these are of a set and that since one of the set members
does AM machinations, then all belong in AM.  For now I think its fine.

> On 2010-11-08 12:13:11, Jonathan Gray wrote:
> > trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java,
line 97
> > <http://review.cloudera.org/r/1187/diff/2/?file=16888#file16888line97>
> >
> >     This is for repeated runs of enable?  Should we log if this actually removes
regions (table has X total regions, already Y online, assigning Z still offline)?
> >     
> >     It's okay that this operation is not done under any locks?  Couldn't regions
be coming online/offline concurrent with this operation?

Added logging to enable/disable.

Regards 'locks', these are my own local copies of these Lists.  Also notion that regions in
table count can change is sort of allowed..  Each time through loop we'll recheck .META. for
enabling and we'll re-look at the list of table regions in AssignmentManager....

> On 2010-11-08 12:13:11, Jonathan Gray wrote:
> > trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java, line 41
> > <http://review.cloudera.org/r/1187/diff/2/?file=16890#file16890line41>
> >
> >     enum?


> On 2010-11-08 12:13:11, Jonathan Gray wrote:
> > trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java, line 716
> > <http://review.cloudera.org/r/1187/diff/2/?file=16892#file16892line716>
> >
> >     What is this method's policy on watches?  Please note it in javadoc.  This method
is not at all strict and is multiple operations so is not safe to use on nodes where we rely
on watches / monitoring of state transitions, so let's make some kind of note.

K. This method is for non-watched znode.  Will add this to javadoc.

- stack

This is an automatically generated e-mail. To reply, visit:

On 2010-11-08 11:47:12, stack wrote:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://review.cloudera.org/r/1187/
> -----------------------------------------------------------
> (Updated 2010-11-08 11:47:12)
> Review request for hbase and Jonathan Gray.
> Summary
> -------
> Renamed ZKTableDisable as ZKTable, making it a generic zk util for managing 'tables'.
> Added enabing/disabling states to table the current set of enabled/disabled only.
> M src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
>   (createSetData): Added.
> M src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
>   Removed offlining region utility methods no longer used.
>   (We do it now over in MetaEditor)
> M src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
>   Javadoc.
> M src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
>   Add a base abstract class to do 'bulk assignments'.  Redo
>   assignAllUserRegions to use subclass of new bulk assigner class.
>   Added isTableEnabled, disablingTable, enablingTable.
> M src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
>   Redid to use new bulk assigner class.
> M src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
> A Added TestZKTable
> This addresses bug hbase-3112.
>     http://issues.apache.org/jira/browse/hbase-3112
> Diffs
> -----
>   trunk/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java 1032652 
>   trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java 1032652

>   trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java 1032652 
>   trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 1032652 
>   trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
>   trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
>   trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
>   trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 1032652 
>   trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java PRE-CREATION 
>   trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableDisable.java 1032652 
>   trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java 1032652 
>   trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java 1032652

>   trunk/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKTable.java PRE-CREATION

> Diff: http://review.cloudera.org/r/1187/diff
> Testing
> -------
> Thanks,
> stack

View raw message