001/**
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *     http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 */
019package org.apache.hadoop.hbase.util;
020
021import static org.junit.Assert.assertEquals;
022import static org.junit.Assert.fail;
023
024import java.io.IOException;
025import java.util.ArrayList;
026import java.util.Collection;
027import java.util.EnumSet;
028import java.util.HashMap;
029import java.util.List;
030import java.util.Map;
031import java.util.Optional;
032import java.util.UUID;
033import java.util.concurrent.CountDownLatch;
034import java.util.concurrent.ExecutorService;
035import java.util.concurrent.ScheduledThreadPoolExecutor;
036import org.apache.hadoop.conf.Configuration;
037import org.apache.hadoop.fs.FileStatus;
038import org.apache.hadoop.fs.FileSystem;
039import org.apache.hadoop.fs.Path;
040import org.apache.hadoop.hbase.ClusterMetrics;
041import org.apache.hadoop.hbase.ClusterMetrics.Option;
042import org.apache.hadoop.hbase.HBaseTestingUtility;
043import org.apache.hadoop.hbase.HColumnDescriptor;
044import org.apache.hadoop.hbase.HConstants;
045import org.apache.hadoop.hbase.HRegionLocation;
046import org.apache.hadoop.hbase.HTableDescriptor;
047import org.apache.hadoop.hbase.ServerName;
048import org.apache.hadoop.hbase.TableName;
049import org.apache.hadoop.hbase.client.Admin;
050import org.apache.hadoop.hbase.client.ClusterConnection;
051import org.apache.hadoop.hbase.client.Connection;
052import org.apache.hadoop.hbase.client.ConnectionFactory;
053import org.apache.hadoop.hbase.client.Delete;
054import org.apache.hadoop.hbase.client.Put;
055import org.apache.hadoop.hbase.client.RegionInfo;
056import org.apache.hadoop.hbase.client.RegionLocator;
057import org.apache.hadoop.hbase.client.Scan;
058import org.apache.hadoop.hbase.client.Table;
059import org.apache.hadoop.hbase.client.TableDescriptor;
060import org.apache.hadoop.hbase.coprocessor.MasterCoprocessor;
061import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
062import org.apache.hadoop.hbase.coprocessor.MasterObserver;
063import org.apache.hadoop.hbase.coprocessor.ObserverContext;
064import org.apache.hadoop.hbase.master.assignment.AssignmentManager;
065import org.apache.hadoop.hbase.master.assignment.RegionStates;
066import org.apache.hadoop.hbase.mob.MobFileName;
067import org.apache.hadoop.hbase.mob.MobUtils;
068import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
069import org.apache.hadoop.hbase.util.hbck.HFileCorruptionChecker;
070import org.apache.zookeeper.KeeperException;
071import org.junit.rules.TestName;
072import org.slf4j.Logger;
073import org.slf4j.LoggerFactory;
074
075import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
076import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos;
077
078/**
079 * This is the base class for  HBaseFsck's ability to detect reasons for inconsistent tables.
080 *
081 * Actual tests are in :
082 * TestHBaseFsckTwoRS
083 * TestHBaseFsckOneRS
084 * TestHBaseFsckMOB
085 * TestHBaseFsckReplicas
086 */
087public class BaseTestHBaseFsck {
088  static final int POOL_SIZE = 7;
089  protected static final Logger LOG = LoggerFactory.getLogger(BaseTestHBaseFsck.class);
090  protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
091  protected final static Configuration conf = TEST_UTIL.getConfiguration();
092  protected final static String FAM_STR = "fam";
093  protected final static byte[] FAM = Bytes.toBytes(FAM_STR);
094  protected final static int REGION_ONLINE_TIMEOUT = 800;
095  protected static AssignmentManager assignmentManager;
096  protected static RegionStates regionStates;
097  protected static ExecutorService tableExecutorService;
098  protected static ScheduledThreadPoolExecutor hbfsckExecutorService;
099  protected static ClusterConnection connection;
100  protected static Admin admin;
101
102  // for the instance, reset every test run
103  protected Table tbl;
104  protected final static byte[][] SPLITS = new byte[][] { Bytes.toBytes("A"),
105    Bytes.toBytes("B"), Bytes.toBytes("C") };
106  // one row per region.
107  protected final static byte[][] ROWKEYS= new byte[][] {
108    Bytes.toBytes("00"), Bytes.toBytes("50"), Bytes.toBytes("A0"), Bytes.toBytes("A5"),
109    Bytes.toBytes("B0"), Bytes.toBytes("B5"), Bytes.toBytes("C0"), Bytes.toBytes("C5") };
110
111  /**
112   * Debugging method to dump the contents of meta.
113   */
114  protected void dumpMeta(TableName tableName) throws IOException {
115    List<byte[]> metaRows = TEST_UTIL.getMetaTableRows(tableName);
116    for (byte[] row : metaRows) {
117      LOG.info(Bytes.toString(row));
118    }
119  }
120
121  /**
122   * This method is used to undeploy a region -- close it and attempt to
123   * remove its state from the Master.
124   */
125  protected void undeployRegion(Connection conn, ServerName sn,
126      RegionInfo hri) throws IOException, InterruptedException {
127    try {
128      HBaseFsckRepair.closeRegionSilentlyAndWait(conn, sn, hri);
129      if (!hri.isMetaRegion()) {
130        admin.offline(hri.getRegionName());
131      }
132    } catch (IOException ioe) {
133      LOG.warn("Got exception when attempting to offline region "
134          + Bytes.toString(hri.getRegionName()), ioe);
135    }
136  }
137  /**
138   * Delete a region from assignments, meta, or completely from hdfs.
139   * @param unassign if true unassign region if assigned
140   * @param metaRow  if true remove region's row from META
141   * @param hdfs if true remove region's dir in HDFS
142   */
143  protected void deleteRegion(Configuration conf, final HTableDescriptor htd,
144      byte[] startKey, byte[] endKey, boolean unassign, boolean metaRow,
145      boolean hdfs) throws IOException, InterruptedException {
146    deleteRegion(conf, htd, startKey, endKey, unassign, metaRow, hdfs, false,
147        RegionInfo.DEFAULT_REPLICA_ID);
148  }
149
150  /**
151   * Delete a region from assignments, meta, or completely from hdfs.
152   * @param unassign if true unassign region if assigned
153   * @param metaRow  if true remove region's row from META
154   * @param hdfs if true remove region's dir in HDFS
155   * @param regionInfoOnly if true remove a region dir's .regioninfo file
156   * @param replicaId replica id
157   */
158  protected void deleteRegion(Configuration conf, final HTableDescriptor htd,
159      byte[] startKey, byte[] endKey, boolean unassign, boolean metaRow,
160      boolean hdfs, boolean regionInfoOnly, int replicaId)
161          throws IOException, InterruptedException {
162    LOG.info("** Before delete:");
163    dumpMeta(htd.getTableName());
164
165    List<HRegionLocation> locations;
166    try(RegionLocator rl = connection.getRegionLocator(tbl.getName())) {
167      locations = rl.getAllRegionLocations();
168    }
169
170    for (HRegionLocation location : locations) {
171      RegionInfo hri = location.getRegionInfo();
172      ServerName hsa = location.getServerName();
173      if (Bytes.compareTo(hri.getStartKey(), startKey) == 0
174          && Bytes.compareTo(hri.getEndKey(), endKey) == 0
175          && hri.getReplicaId() == replicaId) {
176
177        LOG.info("RegionName: " +hri.getRegionNameAsString());
178        byte[] deleteRow = hri.getRegionName();
179
180        if (unassign) {
181          LOG.info("Undeploying region " + hri + " from server " + hsa);
182          undeployRegion(connection, hsa, hri);
183        }
184
185        if (regionInfoOnly) {
186          LOG.info("deleting hdfs .regioninfo data: " + hri.toString() + hsa.toString());
187          Path rootDir = FSUtils.getRootDir(conf);
188          FileSystem fs = rootDir.getFileSystem(conf);
189          Path p = new Path(FSUtils.getTableDir(rootDir, htd.getTableName()),
190              hri.getEncodedName());
191          Path hriPath = new Path(p, HRegionFileSystem.REGION_INFO_FILE);
192          fs.delete(hriPath, true);
193        }
194
195        if (hdfs) {
196          LOG.info("deleting hdfs data: " + hri.toString() + hsa.toString());
197          Path rootDir = FSUtils.getRootDir(conf);
198          FileSystem fs = rootDir.getFileSystem(conf);
199          Path p = new Path(FSUtils.getTableDir(rootDir, htd.getTableName()),
200              hri.getEncodedName());
201          HBaseFsck.debugLsr(conf, p);
202          boolean success = fs.delete(p, true);
203          LOG.info("Deleted " + p + " sucessfully? " + success);
204          HBaseFsck.debugLsr(conf, p);
205        }
206
207        if (metaRow) {
208          try (Table meta = connection.getTable(TableName.META_TABLE_NAME, tableExecutorService)) {
209            Delete delete = new Delete(deleteRow);
210            meta.delete(delete);
211          }
212        }
213      }
214      LOG.info(hri.toString() + hsa.toString());
215    }
216
217    TEST_UTIL.getMetaTableRows(htd.getTableName());
218    LOG.info("*** After delete:");
219    dumpMeta(htd.getTableName());
220  }
221
222  /**
223   * Setup a clean table before we start mucking with it.
224   *
225   * It will set tbl which needs to be closed after test
226   *
227   * @throws IOException
228   * @throws InterruptedException
229   * @throws KeeperException
230   */
231  void setupTable(TableName tablename) throws Exception {
232    setupTableWithRegionReplica(tablename, 1);
233  }
234
235  /**
236   * Setup a clean table with a certain region_replica count
237   *
238   * It will set tbl which needs to be closed after test
239   *
240   * @throws Exception
241   */
242  void setupTableWithRegionReplica(TableName tablename, int replicaCount) throws Exception {
243    HTableDescriptor desc = new HTableDescriptor(tablename);
244    desc.setRegionReplication(replicaCount);
245    HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM));
246    desc.addFamily(hcd); // If a table has no CF's it doesn't get checked
247    createTable(TEST_UTIL, desc, SPLITS);
248
249    tbl = connection.getTable(tablename, tableExecutorService);
250    List<Put> puts = new ArrayList<>(ROWKEYS.length);
251    for (byte[] row : ROWKEYS) {
252      Put p = new Put(row);
253      p.addColumn(FAM, Bytes.toBytes("val"), row);
254      puts.add(p);
255    }
256    tbl.put(puts);
257  }
258
259  /**
260   * Setup a clean table with a mob-enabled column.
261   *
262   * @param tablename The name of a table to be created.
263   * @throws Exception
264   */
265  void setupMobTable(TableName tablename) throws Exception {
266    HTableDescriptor desc = new HTableDescriptor(tablename);
267    HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM));
268    hcd.setMobEnabled(true);
269    hcd.setMobThreshold(0);
270    desc.addFamily(hcd); // If a table has no CF's it doesn't get checked
271    createTable(TEST_UTIL, desc, SPLITS);
272
273    tbl = connection.getTable(tablename, tableExecutorService);
274    List<Put> puts = new ArrayList<>(ROWKEYS.length);
275    for (byte[] row : ROWKEYS) {
276      Put p = new Put(row);
277      p.addColumn(FAM, Bytes.toBytes("val"), row);
278      puts.add(p);
279    }
280    tbl.put(puts);
281  }
282
283  /**
284   * Counts the number of rows to verify data loss or non-dataloss.
285   */
286  int countRows() throws IOException {
287     return TEST_UTIL.countRows(tbl);
288  }
289
290  /**
291   * Counts the number of rows to verify data loss or non-dataloss.
292   */
293  int countRows(byte[] start, byte[] end) throws IOException {
294    return TEST_UTIL.countRows(tbl, new Scan(start, end));
295  }
296
297  /**
298   * delete table in preparation for next test
299   *
300   * @param tablename
301   * @throws IOException
302   */
303  void cleanupTable(TableName tablename) throws Exception {
304    if (tbl != null) {
305      tbl.close();
306      tbl = null;
307    }
308
309    ((ClusterConnection) connection).clearRegionCache();
310    deleteTable(TEST_UTIL, tablename);
311  }
312
313  /**
314   * Get region info from local cluster.
315   */
316  Map<ServerName, List<String>> getDeployedHRIs(final Admin admin) throws IOException {
317    ClusterMetrics status = admin.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS));
318    Collection<ServerName> regionServers = status.getLiveServerMetrics().keySet();
319    Map<ServerName, List<String>> mm = new HashMap<>();
320    for (ServerName hsi : regionServers) {
321      AdminProtos.AdminService.BlockingInterface server = connection.getAdmin(hsi);
322
323      // list all online regions from this region server
324      List<RegionInfo> regions = ProtobufUtil.getOnlineRegions(server);
325      List<String> regionNames = new ArrayList<>(regions.size());
326      for (RegionInfo hri : regions) {
327        regionNames.add(hri.getRegionNameAsString());
328      }
329      mm.put(hsi, regionNames);
330    }
331    return mm;
332  }
333
334  /**
335   * Returns the HSI a region info is on.
336   */
337  ServerName findDeployedHSI(Map<ServerName, List<String>> mm, RegionInfo hri) {
338    for (Map.Entry<ServerName,List <String>> e : mm.entrySet()) {
339      if (e.getValue().contains(hri.getRegionNameAsString())) {
340        return e.getKey();
341      }
342    }
343    return null;
344  }
345
346  public void deleteTableDir(TableName table) throws IOException {
347    Path rootDir = FSUtils.getRootDir(conf);
348    FileSystem fs = rootDir.getFileSystem(conf);
349    Path p = FSUtils.getTableDir(rootDir, table);
350    HBaseFsck.debugLsr(conf, p);
351    boolean success = fs.delete(p, true);
352    LOG.info("Deleted " + p + " sucessfully? " + success);
353  }
354
355  /**
356   * We don't have an easy way to verify that a flush completed, so we loop until we find a
357   * legitimate hfile and return it.
358   * @param fs
359   * @param table
360   * @return Path of a flushed hfile.
361   * @throws IOException
362   */
363  Path getFlushedHFile(FileSystem fs, TableName table) throws IOException {
364    Path tableDir= FSUtils.getTableDir(FSUtils.getRootDir(conf), table);
365    Path regionDir = FSUtils.getRegionDirs(fs, tableDir).get(0);
366    Path famDir = new Path(regionDir, FAM_STR);
367
368    // keep doing this until we get a legit hfile
369    while (true) {
370      FileStatus[] hfFss = fs.listStatus(famDir);
371      if (hfFss.length == 0) {
372        continue;
373      }
374      for (FileStatus hfs : hfFss) {
375        if (!hfs.isDirectory()) {
376          return hfs.getPath();
377        }
378      }
379    }
380  }
381
382  /**
383   * Gets flushed mob files.
384   * @param fs The current file system.
385   * @param table The current table name.
386   * @return Path of a flushed hfile.
387   * @throws IOException
388   */
389  Path getFlushedMobFile(FileSystem fs, TableName table) throws IOException {
390    Path famDir = MobUtils.getMobFamilyPath(conf, table, FAM_STR);
391
392    // keep doing this until we get a legit hfile
393    while (true) {
394      FileStatus[] hfFss = fs.listStatus(famDir);
395      if (hfFss.length == 0) {
396        continue;
397      }
398      for (FileStatus hfs : hfFss) {
399        if (!hfs.isDirectory()) {
400          return hfs.getPath();
401        }
402      }
403    }
404  }
405
406  /**
407   * Creates a new mob file name by the old one.
408   * @param oldFileName The old mob file name.
409   * @return The new mob file name.
410   */
411  String createMobFileName(String oldFileName) {
412    MobFileName mobFileName = MobFileName.create(oldFileName);
413    String startKey = mobFileName.getStartKey();
414    String date = mobFileName.getDate();
415    return MobFileName.create(startKey, date, UUID.randomUUID().toString().replaceAll("-", ""))
416      .getFileName();
417  }
418
419
420
421
422  /**
423   * Test that use this should have a timeout, because this method could potentially wait forever.
424  */
425  protected void doQuarantineTest(TableName table, HBaseFsck hbck, int check,
426                                  int corrupt, int fail, int quar, int missing) throws Exception {
427    try {
428      setupTable(table);
429      assertEquals(ROWKEYS.length, countRows());
430      admin.flush(table); // flush is async.
431
432      // Mess it up by leaving a hole in the assignment, meta, and hdfs data
433      admin.disableTable(table);
434
435      String[] args = {"-sidelineCorruptHFiles", "-repairHoles", "-ignorePreCheckPermission",
436          table.getNameAsString()};
437      HBaseFsck res = hbck.exec(hbfsckExecutorService, args);
438
439      HFileCorruptionChecker hfcc = res.getHFilecorruptionChecker();
440      assertEquals(hfcc.getHFilesChecked(), check);
441      assertEquals(hfcc.getCorrupted().size(), corrupt);
442      assertEquals(hfcc.getFailures().size(), fail);
443      assertEquals(hfcc.getQuarantined().size(), quar);
444      assertEquals(hfcc.getMissing().size(), missing);
445
446      // its been fixed, verify that we can enable
447      admin.enableTableAsync(table);
448      while (!admin.isTableEnabled(table)) {
449        try {
450          Thread.sleep(250);
451        } catch (InterruptedException e) {
452          e.printStackTrace();
453          fail("Interrupted when trying to enable table " + table);
454        }
455      }
456    } finally {
457      cleanupTable(table);
458    }
459  }
460
461
462  static class MockErrorReporter implements HbckErrorReporter {
463    static int calledCount = 0;
464
465    @Override
466    public void clear() {
467      calledCount++;
468    }
469
470    @Override
471    public void report(String message) {
472      calledCount++;
473    }
474
475    @Override
476    public void reportError(String message) {
477      calledCount++;
478    }
479
480    @Override
481    public void reportError(ERROR_CODE errorCode, String message) {
482      calledCount++;
483    }
484
485    @Override
486    public void reportError(ERROR_CODE errorCode, String message, HbckTableInfo table) {
487      calledCount++;
488    }
489
490    @Override
491    public void reportError(ERROR_CODE errorCode,
492        String message, HbckTableInfo table, HbckRegionInfo info) {
493      calledCount++;
494    }
495
496    @Override
497    public void reportError(ERROR_CODE errorCode, String message,
498        HbckTableInfo table, HbckRegionInfo info1, HbckRegionInfo info2) {
499      calledCount++;
500    }
501
502    @Override
503    public int summarize() {
504      return ++calledCount;
505    }
506
507    @Override
508    public void detail(String details) {
509      calledCount++;
510    }
511
512    @Override
513    public ArrayList<ERROR_CODE> getErrorList() {
514      calledCount++;
515      return new ArrayList<>();
516    }
517
518    @Override
519    public void progress() {
520      calledCount++;
521    }
522
523    @Override
524    public void print(String message) {
525      calledCount++;
526    }
527
528    @Override
529    public void resetErrors() {
530      calledCount++;
531    }
532
533    @Override
534    public boolean tableHasErrors(HbckTableInfo table) {
535      calledCount++;
536      return false;
537    }
538  }
539
540
541  protected void deleteMetaRegion(Configuration conf, boolean unassign, boolean hdfs,
542                                  boolean regionInfoOnly) throws IOException, InterruptedException {
543    HRegionLocation metaLocation = connection.getRegionLocator(TableName.META_TABLE_NAME)
544        .getRegionLocation(HConstants.EMPTY_START_ROW);
545    ServerName hsa = metaLocation.getServerName();
546    RegionInfo hri = metaLocation.getRegionInfo();
547    if (unassign) {
548      LOG.info("Undeploying meta region " + hri + " from server " + hsa);
549      try (Connection unmanagedConnection = ConnectionFactory.createConnection(conf)) {
550        undeployRegion(unmanagedConnection, hsa, hri);
551      }
552    }
553
554    if (regionInfoOnly) {
555      LOG.info("deleting hdfs .regioninfo data: " + hri.toString() + hsa.toString());
556      Path rootDir = FSUtils.getRootDir(conf);
557      FileSystem fs = rootDir.getFileSystem(conf);
558      Path p = new Path(rootDir + "/" + TableName.META_TABLE_NAME.getNameAsString(),
559          hri.getEncodedName());
560      Path hriPath = new Path(p, HRegionFileSystem.REGION_INFO_FILE);
561      fs.delete(hriPath, true);
562    }
563
564    if (hdfs) {
565      LOG.info("deleting hdfs data: " + hri.toString() + hsa.toString());
566      Path rootDir = FSUtils.getRootDir(conf);
567      FileSystem fs = rootDir.getFileSystem(conf);
568      Path p = new Path(rootDir + "/" + TableName.META_TABLE_NAME.getNameAsString(),
569          hri.getEncodedName());
570      HBaseFsck.debugLsr(conf, p);
571      boolean success = fs.delete(p, true);
572      LOG.info("Deleted " + p + " sucessfully? " + success);
573      HBaseFsck.debugLsr(conf, p);
574    }
575  }
576
577  @org.junit.Rule
578  public TestName name = new TestName();
579
580  public static class MasterSyncCoprocessor implements MasterCoprocessor, MasterObserver {
581    volatile CountDownLatch tableCreationLatch = null;
582    volatile CountDownLatch tableDeletionLatch = null;
583
584    @Override
585    public Optional<MasterObserver> getMasterObserver() {
586      return Optional.of(this);
587    }
588
589    @Override
590    public void postCompletedCreateTableAction(
591        final ObserverContext<MasterCoprocessorEnvironment> ctx,
592        final TableDescriptor desc,
593        final RegionInfo[] regions) throws IOException {
594      // the AccessController test, some times calls only and directly the
595      // postCompletedCreateTableAction()
596      if (tableCreationLatch != null) {
597        tableCreationLatch.countDown();
598      }
599    }
600
601    @Override
602    public void postCompletedDeleteTableAction(
603        final ObserverContext<MasterCoprocessorEnvironment> ctx,
604        final TableName tableName) throws IOException {
605      // the AccessController test, some times calls only and directly the
606      // postCompletedDeleteTableAction()
607      if (tableDeletionLatch != null) {
608        tableDeletionLatch.countDown();
609      }
610    }
611  }
612
613  public static void createTable(HBaseTestingUtility testUtil, HTableDescriptor htd,
614    byte [][] splitKeys) throws Exception {
615    // NOTE: We need a latch because admin is not sync,
616    // so the postOp coprocessor method may be called after the admin operation returned.
617    MasterSyncCoprocessor coproc = testUtil.getHBaseCluster().getMaster()
618        .getMasterCoprocessorHost().findCoprocessor(MasterSyncCoprocessor.class);
619    coproc.tableCreationLatch = new CountDownLatch(1);
620    if (splitKeys != null) {
621      admin.createTable(htd, splitKeys);
622    } else {
623      admin.createTable(htd);
624    }
625    coproc.tableCreationLatch.await();
626    coproc.tableCreationLatch = null;
627    testUtil.waitUntilAllRegionsAssigned(htd.getTableName());
628  }
629
630  public static void deleteTable(HBaseTestingUtility testUtil, TableName tableName)
631    throws Exception {
632    // NOTE: We need a latch because admin is not sync,
633    // so the postOp coprocessor method may be called after the admin operation returned.
634    MasterSyncCoprocessor coproc = testUtil.getHBaseCluster().getMaster()
635      .getMasterCoprocessorHost().findCoprocessor(MasterSyncCoprocessor.class);
636    coproc.tableDeletionLatch = new CountDownLatch(1);
637    try {
638      admin.disableTable(tableName);
639    } catch (Exception e) {
640      LOG.debug("Table: " + tableName + " already disabled, so just deleting it.");
641    }
642    admin.deleteTable(tableName);
643    coproc.tableDeletionLatch.await();
644    coproc.tableDeletionLatch = null;
645  }
646}