HBASE-874 deleting a table kills client rpc; no subsequent communication if shell or thrift server, etc. (Jonathan Gray via Jim Kellerman)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@692596 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9553b1c946
commit
2e13c047ab
|
@ -76,6 +76,8 @@ Release 0.18.0 - Unreleased
|
|||
HRegionServer (Jean-Daniel Cryans via Jim Kellerman)
|
||||
HBASE-840 More options on the row query in REST interface
|
||||
(Sishen Freecity via Stack)
|
||||
HBASE-874 deleting a table kills client rpc; no subsequent communication if
|
||||
shell or thrift server, etc. (Jonathan Gray via Jim Kellerman)
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-787 Postgresql to HBase table replication example (Tim Sell via Stack)
|
||||
|
|
|
@ -76,7 +76,7 @@ class HMerge implements HConstants {
|
|||
throws IOException {
|
||||
HConnection connection = HConnectionManager.getConnection(conf);
|
||||
boolean masterIsRunning = connection.isMasterRunning();
|
||||
HConnectionManager.deleteConnectionInfo(conf);
|
||||
HConnectionManager.deleteConnectionInfo(conf, false);
|
||||
if (Bytes.equals(tableName, META_TABLE_NAME)) {
|
||||
if (masterIsRunning) {
|
||||
throw new IllegalStateException(
|
||||
|
|
|
@ -267,7 +267,7 @@ public class HBaseAdmin {
|
|||
}
|
||||
}
|
||||
// Delete cached information to prevent clients from using old locations
|
||||
HConnectionManager.deleteConnectionInfo(conf);
|
||||
HConnectionManager.deleteConnectionInfo(conf, false);
|
||||
LOG.info("Deleted " + Bytes.toString(tableName));
|
||||
}
|
||||
|
||||
|
|
|
@ -95,29 +95,18 @@ public class HConnectionManager implements HConstants {
|
|||
/**
|
||||
* Delete connection information for the instance specified by the configuration
|
||||
* @param conf
|
||||
* @param stopProxy
|
||||
*/
|
||||
public static void deleteConnectionInfo(HBaseConfiguration conf) {
|
||||
public static void deleteConnectionInfo(HBaseConfiguration conf,
|
||||
boolean stopProxy) {
|
||||
synchronized (HBASE_INSTANCES) {
|
||||
TableServers t = HBASE_INSTANCES.remove(conf.get(HBASE_DIR));
|
||||
if (t != null) {
|
||||
t.close();
|
||||
t.close(stopProxy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the static map of connection info.
|
||||
*/
|
||||
public static void deleteConnectionInfo() {
|
||||
synchronized (HBASE_INSTANCES) {
|
||||
for (TableServers t: HBASE_INSTANCES.values()) {
|
||||
t.close();
|
||||
}
|
||||
HBASE_INSTANCES.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Encapsulates finding the servers for an HBase instance */
|
||||
private static class TableServers implements HConnection, HConstants {
|
||||
private static final Log LOG = LogFactory.getLog(TableServers.class);
|
||||
|
@ -894,12 +883,15 @@ public class HConnectionManager implements HConstants {
|
|||
return null;
|
||||
}
|
||||
|
||||
void close() {
|
||||
void close(boolean stopProxy) {
|
||||
if (master != null) {
|
||||
if (stopProxy) {
|
||||
HbaseRPC.stopProxy(master);
|
||||
}
|
||||
master = null;
|
||||
masterChecked = false;
|
||||
}
|
||||
if (stopProxy) {
|
||||
synchronized (servers) {
|
||||
for (HRegionInterface i: servers.values()) {
|
||||
HbaseRPC.stopProxy(i);
|
||||
|
@ -907,5 +899,6 @@ public class HConnectionManager implements HConstants {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ public abstract class HBaseClusterTestCase extends HBaseTestCase {
|
|||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
try {
|
||||
HConnectionManager.deleteConnectionInfo(conf);
|
||||
HConnectionManager.deleteConnectionInfo(conf, true);
|
||||
if (this.cluster != null) {
|
||||
try {
|
||||
this.cluster.shutdown();
|
||||
|
|
|
@ -50,7 +50,7 @@ public class DisabledTestMetaUtils extends HBaseClusterTestCase {
|
|||
utils.deleteColumn(editTable, Bytes.toBytes(oldColumn));
|
||||
utils.shutdown();
|
||||
// Delete again so we go get it all fresh.
|
||||
HConnectionManager.deleteConnectionInfo();
|
||||
HConnectionManager.deleteConnectionInfo(conf, false);
|
||||
// Now assert columns were added and deleted.
|
||||
this.cluster = new MiniHBaseCluster(this.conf, 1);
|
||||
// Now assert columns were added and deleted.
|
||||
|
|
|
@ -134,7 +134,7 @@ public class TestMigrate extends HBaseTestCase {
|
|||
// Delete any cached connections. Need to do this because connection was
|
||||
// created earlier when no master was around. The fact that there was no
|
||||
// master gets cached. Need to delete so we go get master afresh.
|
||||
HConnectionManager.deleteConnectionInfo();
|
||||
HConnectionManager.deleteConnectionInfo(conf, false);
|
||||
|
||||
LOG.info("Start a cluster against migrated FS");
|
||||
// Up number of retries. Needed while cluster starts up. Its been set to 1
|
||||
|
@ -159,7 +159,7 @@ public class TestMigrate extends HBaseTestCase {
|
|||
"changes before opening a scanner");
|
||||
waitOnStartCodeChange(retries);
|
||||
// Delete again so we go get it all fresh.
|
||||
HConnectionManager.deleteConnectionInfo();
|
||||
HConnectionManager.deleteConnectionInfo(conf, false);
|
||||
HTable t = new HTable(this.conf, TABLENAME);
|
||||
int count = 0;
|
||||
LOG.info("OPENING SCANNER");
|
||||
|
@ -179,7 +179,7 @@ public class TestMigrate extends HBaseTestCase {
|
|||
s.close();
|
||||
}
|
||||
} finally {
|
||||
HConnectionManager.deleteConnectionInfo();
|
||||
HConnectionManager.deleteConnectionInfo(conf, false);
|
||||
cluster.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue