Issue Details (XML | Word | Printable)

Key: HBASE-1602
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: stack
Reporter: stack
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop HBase

HRegionServer won't go down since we added in new LruBlockCache

Created: 01/Jul/09 11:51 PM   Updated: 13/Sep/09 10:24 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.20.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works shutdown.patch 2009-07-01 11:52 PM stack 2 kB

Resolution Date: 02/Jul/09 12:12 AM


 Description  « Hide
New LruBlockCache uses thread excecutor scheduling stats dumping. The scheduled excecutor needs to be cancelled else it just stays running stopping the HRS going down.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
stack added a comment - 01/Jul/09 11:52 PM
Add a shutdown the the BlockCache interface. Change SimpleBlockCache and LruBlockCache so they implement new shutdown.

stack made changes - 01/Jul/09 11:52 PM
Field Original Value New Value
Attachment shutdown.patch [ 12412341 ]
Repository Revision Date User Message
ASF #790424 Wed Jul 01 23:57:40 UTC 2009 stack HBASE-1602 HRegionServer won't go down since we added in new LruBlockCache
Files Changed
MODIFY /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
MODIFY /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/SimpleBlockCache.java
MODIFY /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java
MODIFY /hadoop/hbase/trunk/CHANGES.txt
MODIFY /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

stack added a comment - 02/Jul/09 12:12 AM
Committed after testing. Easy to reproduce the problem.

stack made changes - 02/Jul/09 12:12 AM
Resolution Fixed [ 1 ]
Assignee stack [ stack ]
Status Open [ 1 ] Resolved [ 5 ]
Repository Revision Date User Message
ASF #790434 Thu Jul 02 02:00:31 UTC 2009 apurtell HBASE-1602
Files Changed
MODIFY /hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/io/hfile/SimpleBlockCache.java
MODIFY /hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java
MODIFY /hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt
MODIFY /hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
MODIFY /hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

stack added a comment - 03/Jul/09 12:08 AM
Committing the below under the aegis if this issue:
Index: src/java/org/apache/hadoop/hbase/master/HMaster.java
===================================================================
--- src/java/org/apache/hadoop/hbase/master/HMaster.java        (revision 790761)
+++ src/java/org/apache/hadoop/hbase/master/HMaster.java        (working copy)
@@ -271,6 +271,12 @@
   private void bootstrap() throws IOException {
     LOG.info("BOOTSTRAP: creating ROOT and first META regions");
     try {
+      // Bootstrapping, make sure blockcache is off.  Else, one will be
+      // created here in bootstap and it'll need to be cleaned up.  Better to
+      // not make it in first place.  Turn off block caching for bootstrap.
+      // Enable after.
+      setBlockCaching(HRegionInfo.ROOT_REGIONINFO, false);
+      setBlockCaching(HRegionInfo.FIRST_META_REGIONINFO, false);
       HRegion root = HRegion.createHRegion(HRegionInfo.ROOT_REGIONINFO,
         this.rootdir, this.conf);
       HRegion meta = HRegion.createHRegion(HRegionInfo.FIRST_META_REGIONINFO,
@@ -281,6 +287,8 @@
       root.getLog().closeAndDelete();
       meta.close();
       meta.getLog().closeAndDelete();
+      setBlockCaching(HRegionInfo.ROOT_REGIONINFO, true);
+      setBlockCaching(HRegionInfo.FIRST_META_REGIONINFO, true);
     } catch (IOException e) {
       e = RemoteExceptionHandler.checkIOException(e);
       LOG.error("bootstrap", e);
@@ -288,6 +296,16 @@
     }
   }
 
+  /*
+   * @param hri Set all family block caching to <code>b</code>
+   * @param b
+   */
+  private void setBlockCaching(final HRegionInfo hri, final boolean b) {
+    for (HColumnDescriptor hcd: hri.getTableDesc().families.values()) {
+      hcd.setBlockCacheEnabled(b);
+    }
+  }
+

There was a subtle condition where a BlockCache would be made in the master if we did a bootstrap. If the block cache was the default LruBlockCache, then it needs a shutdown to go down else the JVM stays up.


Repository Revision Date User Message
ASF #790766 Fri Jul 03 00:08:51 UTC 2009 stack HBASE-1602 HRegionServer won't go down since we added in new LruBlockCache
Files Changed
MODIFY /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java

Andrew Purtell added a comment - 03/Jul/09 01:11 AM
Ah, that explains that. Thanks stack.

stack made changes - 13/Sep/09 10:24 PM
Status Resolved [ 5 ] Closed [ 6 ]