You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/02 10:32:00 UTC

[jira] [Work logged] (HIVE-26106) Non blocking ADD, DROP CONSTRAINT

     [ https://issues.apache.org/jira/browse/HIVE-26106?focusedWorklogId=764891&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764891 ]

ASF GitHub Bot logged work on HIVE-26106:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/May/22 10:31
            Start Date: 02/May/22 10:31
    Worklog Time Spent: 10m 
      Work Description: veghlaci05 commented on code in PR #3165:
URL: https://github.com/apache/hive/pull/3165#discussion_r862742761


##########
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java:
##########
@@ -3816,4 +3816,29 @@ private void testDropMaterializedView(boolean blocking) throws Exception {
     Assert.assertEquals("Expecting 2 rows and found " + res.size(), 2, res.size());
     driver.run("drop materialized view mv_tab_acid");
   }
+
+  @Test
+  public void testAddDropConstraintNonBlocking() throws Exception {
+    HiveConf.setBoolVar(conf, HiveConf.ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED, true);
+    dropTable(new String[] {"tab_acid"});
+
+    driver.run("create table if not exists tab_acid (a int, b int) " +
+      "stored as orc TBLPROPERTIES ('transactional'='true')");
+    driver.run("insert into tab_acid (a,b) values(1,2),(3,4)");
+
+    driver.compileAndRespond("alter table tab_acid ADD CONSTRAINT a_PK PRIMARY KEY (`a`) DISABLE NOVALIDATE");
+    driver.lockAndRespond();
+    
+    List<ShowLocksResponseElement> locks = getLocks();
+    checkLock(LockType.EXCL_WRITE,
+      LockState.ACQUIRED, "default", "tab_acid", null, locks);
+    driver.close();
+    
+    driver.compileAndRespond("alter table tab_acid  DROP CONSTRAINT a_PK");
+    driver.lockAndRespond();
+
+    locks = getLocks();
+    checkLock(LockType.EXCL_WRITE,
+      LockState.ACQUIRED, "default", "tab_acid", null, locks);
+  }

Review Comment:
   It could be separated to two tests, but no strong feelings about it, even the merged test case is small enough.





Issue Time Tracking
-------------------

            Worklog Id:     (was: 764891)
    Remaining Estimate: 0h
            Time Spent: 10m

> Non blocking ADD, DROP CONSTRAINT
> ---------------------------------
>
>                 Key: HIVE-26106
>                 URL: https://issues.apache.org/jira/browse/HIVE-26106
>             Project: Hive
>          Issue Type: Task
>            Reporter: Denys Kuzmenko
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> No need for EXCLUSIVE lock here.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)