[2/9] hbase git commit: HBASE-17287 Master becomes a zombie if filesystem object closes
HBASE-17287 Master becomes a zombie if filesystem object closes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f159557e Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f159557e Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f159557e Branch: refs/heads/hbase-12439 Commit: f159557eded160680e623b966350ea3442b5f35a Parents: 0345fc8 Author: tedyu Authored: Tue Mar 28 20:41:46 2017 -0700 Committer: tedyu Committed: Tue Mar 28 20:41:46 2017 -0700 -- .../hadoop/hbase/master/MasterWalManager.java | 5 + .../procedure/TestSafemodeBringsDownMaster.java | 125 +++ 2 files changed, 130 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/f159557e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java index 27aca94..e67af14 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java @@ -270,6 +270,11 @@ public class MasterWalManager { } logDirs.add(splitDir); } +} catch (IOException ioe) { + if (!checkFileSystem()) { +this.services.abort("Aborting due to filesystem unavailable", ioe); +throw ioe; + } } finally { if (needReleaseLock) { this.splitLogLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/f159557e/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java new file mode 100644 index 000..c255843 --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -0,0 +1,125 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer; +import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; +import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category(MediumTests.class) +public class TestSafemodeBringsDownMaster { + private static final Log LOG = LogFactory.getLog(TestSafemodeBringsDownMaster.class); + + protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + + private static void setupConf(Configuration conf) { +conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); +conf.set(BaseLoadBalancer.TABLES_ON_MASTER, "none"); + } + + @BeforeClass + public static void setupCluster() throws Exception { +set
hbase git commit: HBASE-17287 Master becomes a zombie if filesystem object closes
Repository: hbase Updated Branches: refs/heads/branch-1.1 3ced5e4c5 -> 1fdb97ce8 HBASE-17287 Master becomes a zombie if filesystem object closes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1fdb97ce Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1fdb97ce Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1fdb97ce Branch: refs/heads/branch-1.1 Commit: 1fdb97ce840c10f2b2e4aa4a5c636ae98bfc1c33 Parents: 3ced5e4 Author: tedyu Authored: Wed Mar 29 07:22:31 2017 -0700 Committer: tedyu Committed: Wed Mar 29 07:22:31 2017 -0700 -- .../hadoop/hbase/master/MasterFileSystem.java | 5 + .../procedure/TestSafemodeBringsDownMaster.java | 122 +++ 2 files changed, 127 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/1fdb97ce/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java index bd2b8f5..41af3a2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java @@ -335,6 +335,11 @@ public class MasterFileSystem { } logDirs.add(splitDir); } +} catch (IOException ioe) { + if (!checkFileSystem()) { +this.services.abort("Aborting due to filesystem unavailable", ioe); +throw ioe; + } } finally { if (needReleaseLock) { this.splitLogLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/1fdb97ce/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java new file mode 100644 index 000..dd407ad --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -0,0 +1,122 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; +import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category(MediumTests.class) +public class TestSafemodeBringsDownMaster { + private static final Log LOG = LogFactory.getLog(TestSafemodeBringsDownMaster.class); + + protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + + private static void setupConf(Configuration conf) { +conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); + } + + @BeforeClass + public static void setupCluster() throws Exception { +setupConf(UTIL.getConfiguration()); +UTIL.startMiniCluster(1); + } + + @AfterClass + public static voi
hbase git commit: HBASE-17287 Master becomes a zombie if filesystem object closes
Repository: hbase Updated Branches: refs/heads/branch-1.2 e9ce872e0 -> 2d79b7d5a HBASE-17287 Master becomes a zombie if filesystem object closes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2d79b7d5 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2d79b7d5 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2d79b7d5 Branch: refs/heads/branch-1.2 Commit: 2d79b7d5a508c2175312487db3e93d838e063ec2 Parents: e9ce872 Author: tedyu Authored: Wed Mar 29 07:21:10 2017 -0700 Committer: tedyu Committed: Wed Mar 29 07:21:10 2017 -0700 -- .../hadoop/hbase/master/MasterFileSystem.java | 5 + .../procedure/TestSafemodeBringsDownMaster.java | 131 +++ 2 files changed, 136 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/2d79b7d5/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java index dc43d8c..ba92178 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java @@ -342,6 +342,11 @@ public class MasterFileSystem { } logDirs.add(splitDir); } +} catch (IOException ioe) { + if (!checkFileSystem()) { +this.services.abort("Aborting due to filesystem unavailable", ioe); +throw ioe; + } } finally { if (needReleaseLock) { this.splitLogLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/2d79b7d5/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java new file mode 100644 index 000..b5ee09a --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -0,0 +1,131 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import java.io.IOException; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; +import org.apache.hadoop.hbase.TableExistsException; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; +import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.CreateTableState; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.ModifyRegionUtils; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +@Category(MediumTests.class) +public class TestSafemodeBringsDownMaster { + private static fin
hbase git commit: HBASE-17287 Master becomes a zombie if filesystem object closes
Repository: hbase Updated Branches: refs/heads/branch-1.3 ef55e5875 -> 8c6608f5a HBASE-17287 Master becomes a zombie if filesystem object closes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8c6608f5 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8c6608f5 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8c6608f5 Branch: refs/heads/branch-1.3 Commit: 8c6608f5a92e5bbd3ecc45c7cc7e28a4f05251e7 Parents: ef55e58 Author: tedyu Authored: Wed Mar 29 07:19:21 2017 -0700 Committer: tedyu Committed: Wed Mar 29 07:19:21 2017 -0700 -- .../hadoop/hbase/master/MasterFileSystem.java | 5 + .../procedure/TestSafemodeBringsDownMaster.java | 131 +++ 2 files changed, 136 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/8c6608f5/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java index 5d42399..c15d730 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java @@ -341,6 +341,11 @@ public class MasterFileSystem { } logDirs.add(splitDir); } +} catch (IOException ioe) { + if (!checkFileSystem()) { +this.services.abort("Aborting due to filesystem unavailable", ioe); +throw ioe; + } } finally { if (needReleaseLock) { this.splitLogLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/8c6608f5/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java new file mode 100644 index 000..b5ee09a --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -0,0 +1,131 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import java.io.IOException; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; +import org.apache.hadoop.hbase.TableExistsException; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; +import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.CreateTableState; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.ModifyRegionUtils; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +@Category(MediumTests.class) +public class TestSafemodeBringsDownMaster { + private static fin
hbase git commit: HBASE-17287 Master becomes a zombie if filesystem object closes
Repository: hbase Updated Branches: refs/heads/branch-1 6fe3b5e0f -> d0139a877 HBASE-17287 Master becomes a zombie if filesystem object closes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d0139a87 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d0139a87 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d0139a87 Branch: refs/heads/branch-1 Commit: d0139a8777663aef92e5f1003e5c4682a442bfce Parents: 6fe3b5e Author: tedyu Authored: Wed Mar 29 04:50:49 2017 -0700 Committer: tedyu Committed: Wed Mar 29 04:50:49 2017 -0700 -- .../hadoop/hbase/master/MasterFileSystem.java | 5 + .../procedure/TestSafemodeBringsDownMaster.java | 131 +++ 2 files changed, 136 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/d0139a87/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java index d717832..332a726 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java @@ -372,6 +372,11 @@ public class MasterFileSystem { } logDirs.add(splitDir); } +} catch (IOException ioe) { + if (!checkFileSystem()) { +this.services.abort("Aborting due to filesystem unavailable", ioe); +throw ioe; + } } finally { if (needReleaseLock) { this.splitLogLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/d0139a87/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java new file mode 100644 index 000..b5ee09a --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -0,0 +1,131 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import java.io.IOException; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; +import org.apache.hadoop.hbase.TableExistsException; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; +import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.CreateTableState; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.ModifyRegionUtils; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +@Category(MediumTests.class) +public class TestSafemodeBringsDownMaster { + private static final L
hbase git commit: HBASE-17287 Master becomes a zombie if filesystem object closes
Repository: hbase Updated Branches: refs/heads/master 0345fc877 -> f159557ed HBASE-17287 Master becomes a zombie if filesystem object closes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f159557e Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f159557e Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f159557e Branch: refs/heads/master Commit: f159557eded160680e623b966350ea3442b5f35a Parents: 0345fc8 Author: tedyu Authored: Tue Mar 28 20:41:46 2017 -0700 Committer: tedyu Committed: Tue Mar 28 20:41:46 2017 -0700 -- .../hadoop/hbase/master/MasterWalManager.java | 5 + .../procedure/TestSafemodeBringsDownMaster.java | 125 +++ 2 files changed, 130 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/f159557e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java index 27aca94..e67af14 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java @@ -270,6 +270,11 @@ public class MasterWalManager { } logDirs.add(splitDir); } +} catch (IOException ioe) { + if (!checkFileSystem()) { +this.services.abort("Aborting due to filesystem unavailable", ioe); +throw ioe; + } } finally { if (needReleaseLock) { this.splitLogLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/f159557e/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java new file mode 100644 index 000..c255843 --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -0,0 +1,125 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer; +import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; +import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category(MediumTests.class) +public class TestSafemodeBringsDownMaster { + private static final Log LOG = LogFactory.getLog(TestSafemodeBringsDownMaster.class); + + protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + + private static void setupConf(Configuration conf) { +conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); +conf.set(BaseLoadBalancer.TABLES_ON_MASTER, "none"); + } + + @