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

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

                Author: ASF GitHub Bot
            Created on: 13/Sep/21 10:05
            Start Date: 13/Sep/21 10:05
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2547:
URL: https://github.com/apache/hive/pull/2547#discussion_r707189777



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java
##########
@@ -3243,4 +3251,42 @@ public void testFullTableReadLock() throws Exception {
     checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "tab_acid", 
null, locks);
     checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", 
"tab_not_acid", null, locks);
   }
+
+  @Test
+  public void testInsertSnapshotIsolation() throws Exception {
+    driver.run("create table if not exists acid_insert_snapshot_isolation (a 
int, b int) " +
+        "stored as orc TBLPROPERTIES ('transactional'='true')");
+    driver.compileAndRespond("insert into acid_insert_snapshot_isolation 
values(1,2)");
+    DbTxnManager txnMgr2 = (DbTxnManager) 
TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf);
+    swapTxnManager(txnMgr2);
+    driver2.compileAndRespond("select * from acid_insert_snapshot_isolation");
+    swapTxnManager(txnMgr);
+    driver.run();
+    txnHandler.cleanTxnToWriteIdTable();
+    swapTxnManager(txnMgr2);
+    driver2.run();
+    List res = new ArrayList();
+    driver2.getFetchTask().fetch(res);
+    Assert.assertEquals(0, res.size());
+  }
+
+  @Test
+  public void testUpdateSnapshotIsolation() throws Exception {
+    driver.run("create table if not exists acid_update_snapshot_isolation (a 
int, b int) " +
+        "stored as orc TBLPROPERTIES ('transactional'='true')");
+        driver.run("insert into acid_update_snapshot_isolation values(1,2)");

Review comment:
       nit: formatting




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 649906)
    Time Spent: 7h  (was: 6h 50m)

> cleanTxnToWriteIdTable breaks SNAPSHOT isolation
> ------------------------------------------------
>
>                 Key: HIVE-25346
>                 URL: https://issues.apache.org/jira/browse/HIVE-25346
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Chovan
>            Assignee: Zoltan Chovan
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 7h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to