hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [28/50] [abbrv] hbase git commit: Revert "HBASE-14223 Meta WALs are not cleared if meta region was closed and RS aborts"
Date Mon, 07 Dec 2015 16:56:05 GMT
Revert "HBASE-14223 Meta WALs are not cleared if meta region was closed and RS aborts"

This reverts commit 756e6de2a0948c39a4fb3ab880dd9d182d645dbc.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bbd53b84
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bbd53b84
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bbd53b84

Branch: refs/heads/hbase-12439
Commit: bbd53b846ef6d78740f54f5cea3c73bd992dde09
Parents: a154ecd
Author: Enis Soztutar <enis@apache.org>
Authored: Thu Dec 3 13:28:33 2015 -0800
Committer: Enis Soztutar <enis@apache.org>
Committed: Thu Dec 3 13:28:33 2015 -0800

----------------------------------------------------------------------
 .../hbase/regionserver/HRegionServer.java       | 20 --------------------
 .../hadoop/hbase/regionserver/LogRoller.java    |  4 ----
 .../hbase/regionserver/RSRpcServices.java       |  2 +-
 .../regionserver/RegionServerServices.java      |  6 ------
 .../regionserver/handler/CloseMetaHandler.java  |  8 --------
 .../handler/CloseRegionHandler.java             | 15 +++------------
 .../org/apache/hadoop/hbase/wal/WALFactory.java | 15 ---------------
 .../hadoop/hbase/MockRegionServerServices.java  |  4 ----
 .../hadoop/hbase/master/MockRegionServer.java   | 10 +++-------
 9 files changed, 7 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 5be240d..2ce2193 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -1867,26 +1867,6 @@ public class HRegionServer extends HasThread implements
   }
 
   @Override
-  public void releaseWAL(HRegionInfo regionInfo, WAL wal) throws IOException {
-    if (regionInfo != null && regionInfo.isMetaTable() &&
-        regionInfo.getReplicaId() == HRegionInfo.DEFAULT_REPLICA_ID) {
-
-      walFactory.closeMetaWAL(regionInfo.getEncodedNameAsBytes());
-
-      LogRoller roller;
-      if (regionInfo != null && regionInfo.isMetaTable() &&
-          regionInfo.getReplicaId() == HRegionInfo.DEFAULT_REPLICA_ID) {
-        roller = metawalRoller.get();
-        if (roller != null) {
-          roller.removeWAL(wal); // only do this for meta WAL
-        }
-
-        // TODO: meta wal roller is left running. Should be fine.
-      }
-    }
-  }
-
-  @Override
   public ClusterConnection getConnection() {
     return this.clusterConnection;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
index 12cd060..40edc05 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
@@ -78,10 +78,6 @@ public class LogRoller extends HasThread {
     }
   }
 
-  public void removeWAL(final WAL wal) {
-    walNeedsRoll.remove(wal);
-  }
-
   public void requestRollAll() {
     for (WAL wal : walNeedsRoll.keySet()) {
       walNeedsRoll.put(wal, Boolean.TRUE);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 6fadd0c..d94e11c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1669,7 +1669,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
         return response;
       }
 
-      HRegion.warmupHRegion(region, htd, null,
+      HRegion.warmupHRegion(region, htd, regionServer.getWAL(region),
           regionServer.getConfiguration(), regionServer, null);
 
     } catch (IOException ie) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
index 29e6a95..cd4816c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
@@ -55,12 +55,6 @@ public interface RegionServerServices extends OnlineRegions, FavoredNodesForRegi
   WAL getWAL(HRegionInfo regionInfo) throws IOException;
 
   /**
-   * Releases the dependency of this region to the WAL previously obtained from
-   * {@link #getWAL(HRegionInfo)}.
-   */
-  void releaseWAL(HRegionInfo regionInfo, WAL wal) throws IOException;
-
-  /**
    * @return Implementation of {@link CompactionRequestor} or null.
    */
   CompactionRequestor getCompactionRequester();

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java
index 237eb5a..70e5283 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java
@@ -19,9 +19,6 @@
 package org.apache.hadoop.hbase.regionserver.handler;
 
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
-
-import java.io.IOException;
-
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.executor.EventType;
@@ -40,9 +37,4 @@ public class CloseMetaHandler extends CloseRegionHandler {
       final boolean abort) {
     super(server, rsServices, regionInfo, abort, EventType.M_RS_CLOSE_META, null);
   }
-
-  @Override
-  protected void releaseWALIfNeeded() throws IOException {
-    rsServices.releaseWAL(regionInfo, region.getWAL());
-  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
index b5bab27..26e824d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
@@ -44,9 +44,8 @@ public class CloseRegionHandler extends EventHandler {
   // have a running queue of user regions to close?
   private static final Log LOG = LogFactory.getLog(CloseRegionHandler.class);
 
-  protected final RegionServerServices rsServices;
-  protected final HRegionInfo regionInfo;
-  protected HRegion region;
+  private final RegionServerServices rsServices;
+  private final HRegionInfo regionInfo;
 
   // If true, the hosting server is aborting.  Region close process is different
   // when we are aborting.
@@ -91,7 +90,7 @@ public class CloseRegionHandler extends EventHandler {
       LOG.debug("Processing close of " + name);
       String encodedRegionName = regionInfo.getEncodedName();
       // Check that this region is being served here
-      region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName);
+      HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName);
       if (region == null) {
         LOG.warn("Received CLOSE for region " + name + " but currently not serving - ignoring");
         // TODO: do better than a simple warning
@@ -107,10 +106,6 @@ public class CloseRegionHandler extends EventHandler {
             regionInfo.getRegionNameAsString());
           return;
         }
-
-        if (!abort) {
-          releaseWALIfNeeded();
-        }
       } catch (IOException ioe) {
         // An IOException here indicates that we couldn't successfully flush the
         // memstore before closing. So, we need to abort the server and allow
@@ -130,8 +125,4 @@ public class CloseRegionHandler extends EventHandler {
         remove(this.regionInfo.getEncodedNameAsBytes(), Boolean.FALSE);
     }
   }
-
-  protected void releaseWALIfNeeded() throws IOException {
-    // release the WAL if needed. Only meta does this for now.
-  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
index 7426979..0317b66 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
@@ -250,21 +250,6 @@ public class WALFactory {
     return metaProvider.getWAL(identifier, null);
   }
 
-  /**
-   * Closes the meta WAL and meta WALProvider
-   */
-  public void closeMetaWAL(final byte[] identifier) throws IOException {
-    // NOTE: this assumes single META region. The close of WAL does not do ref-counting for
the
-    // number of regions depending on the meta WAL
-    WALProvider metaProvider = this.metaProvider.get();
-    if (metaProvider != null) {
-      if (this.metaProvider.compareAndSet(metaProvider, null)) {
-        // close the metaProvider
-        metaProvider.close();
-      }
-    }
-  }
-
   public Reader createReader(final FileSystem fs, final Path path) throws IOException {
     return createReader(fs, path, (CancelableProgressable)null);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
index 250d3c1..c126b19 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
@@ -306,8 +306,4 @@ public class MockRegionServerServices implements RegionServerServices
{
   public double getCompactionPressure() {
     return 0;
   }
-
-  @Override
-  public void releaseWAL(HRegionInfo regionInfo, WAL wal) throws IOException {
-  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bbd53b84/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
index e89ce00..eb8f803 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
@@ -66,6 +66,8 @@ import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.MergeRegionsReques
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.MergeRegionsResponse;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WarmupRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WarmupRegionResponse;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ReplicateWALEntryRequest;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ReplicateWALEntryResponse;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.RollWALWriterRequest;
@@ -78,8 +80,6 @@ import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.UpdateConfiguratio
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.UpdateConfigurationResponse;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.UpdateFavoredNodesRequest;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.UpdateFavoredNodesResponse;
-import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WarmupRegionRequest;
-import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WarmupRegionResponse;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileResponse;
@@ -651,8 +651,4 @@ ClientProtos.ClientService.BlockingInterface, RegionServerServices {
   public double getCompactionPressure() {
     return 0;
   }
-
-  @Override
-  public void releaseWAL(HRegionInfo regionInfo, WAL wal) throws IOException {
-  }
-}
+}
\ No newline at end of file


Mime
View raw message