@Test
  public void testAnalyze() throws Exception {
    dropTable(new String[] {"tab_acid", "tab_not_acid"});

    driver.run("create table tab_not_acid (key string, value string) partitioned by (ds string, hr string) " +
        "stored as textfile");
    driver.run("insert into tab_not_acid partition (ds='2008-04-08', hr='11') values ('238', 'val_238')");
    driver.run("analyze table tab_not_acid PARTITION (ds, hr) compute statistics");

    driver.run("create table tab_acid (key string, value string) partitioned by (ds string, hr string) " +
        "stored as orc TBLPROPERTIES ('transactional'='true')");
    driver.run("insert into tab_acid PARTITION (ds, hr) select * from tab_not_acid");
    driver.run("analyze table tab_acid PARTITION (ds, hr) compute statistics");

    conf.setBoolVar(HiveConf.ConfVars.HIVE_TXN_EXT_LOCKING_ENABLED, true);

    driver.compileAndRespond("analyze table tab_not_acid PARTITION(ds, hr) compute statistics", true);
    txnMgr.acquireLocks(driver.getPlan(), ctx, "dummy");

    List<ShowLocksResponseElement> locks = getLocks();
    Assert.assertEquals("Unexpected lock count", 1, locks.size());
    TestTxnDbUtil.checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "tab_not_acid", "ds=2008-04-08/hr=11", locks);
    txnMgr.releaseLocks(ctx.getHiveLocks());

    driver.compileAndRespond("analyze table tab_acid PARTITION(ds, hr) compute statistics");
    txnMgr.acquireLocks(driver.getPlan(), ctx, "dummy");

    locks = getLocks();
    Assert.assertEquals("Unexpected lock count", 1, locks.size());
    TestTxnDbUtil.checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "tab_acid", "ds=2008-04-08/hr=11", locks);
  }
T7 is a table with 2 partitions
1. run select from T7
2. run drop partition from T7
concurrently with 1 starting first so that 2 blocks
3. start another concurrent select on T7 - it should block behind waiting X (from drop) - LM should be fair
4. finish #1 so that drop unblocks
5. rollback the drop to release its X lock
6. # should unblock
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java