alex-plekhanov commented on code in PR #11535:
URL: https://github.com/apache/ignite/pull/11535#discussion_r1775191090


##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java:
##########
@@ -2120,6 +2130,8 @@ private UpdateResult executeUpdate(
                 break;
         }
 
+        heavyQueriesTracker().stopTracking(dmlInfo, null);

Review Comment:
   try/finally block? Perhaps in executeDml method instead of executeUpdate?



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -54,9 +56,33 @@ public class LongRunningQueryTest extends 
AbstractIndexingCommonTest {
     /** Keys count. */
     private static final int KEY_CNT = 1000;
 
+    /** Long query warning timeout. */
+    private static final int LONG_QUERY_WARNING_TIMEOUT = 1000;
+
     /** External wait time. */
     private static final int EXT_WAIT_TIME = 2000;
 
+    /** Insert. */
+    private static final String INSERT = "insert into test (_key, _val) values 
(1001, sleep_func_dml())";

Review Comment:
   INSERT -> INSERT_SQL (the same for other SQLs)



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -54,9 +56,33 @@ public class LongRunningQueryTest extends 
AbstractIndexingCommonTest {
     /** Keys count. */
     private static final int KEY_CNT = 1000;
 
+    /** Long query warning timeout. */
+    private static final int LONG_QUERY_WARNING_TIMEOUT = 1000;
+
     /** External wait time. */
     private static final int EXT_WAIT_TIME = 2000;
 
+    /** Insert. */
+    private static final String INSERT = "insert into test (_key, _val) values 
(1001, sleep_func_dml())";
+
+    /** Insert with a subquery. */
+    private static final String INSERT_WITH_SUBQUERY = "insert into test 
(_key, _val) select p._key, p.orgId from " +
+        "\"pers\".Person p where p._key < sleep_func(?)";
+
+    /** Update. */
+    private static final String UPDATE = "update test set _val = 
sleep_func_dml() where _key = 1";

Review Comment:
   Why we can't always use sleep_func(?) and simplify code? (remove 
sleep_func_dml, remove isSubquery parameter)



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java:
##########
@@ -182,6 +220,106 @@ public void testLongLocalLazy() {
         checkFastQueries();
     }
 
+    /** */
+    @Test
+    public void testLongRunningInsert() {
+        local = false;
+
+        runDml(INSERT, false);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningInsertWithSubquery() {
+        local = false;
+
+        runDml(INSERT_WITH_SUBQUERY, true);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningInsertLocal() {
+        local = true;
+
+        runDml(INSERT, false);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningInsertWithSubqueryLocal() {
+        local = true;
+
+        runDml(INSERT_WITH_SUBQUERY, true);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningUpdate() {
+        local = false;
+
+        runDml(UPDATE, false);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningUpdateWithSubquery() {
+        local = false;
+
+        runDml(UPDATE_WITH_SUBQUERY, true);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningUpdateLocal() {
+        local = true;
+
+        runDml(UPDATE, false);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningUpdateWithSubqueryLocal() {
+        local = true;
+
+        runDml(UPDATE_WITH_SUBQUERY, true);
+    }
+
+    /** */
+    @Test
+    public void testLongRunningDelete() {
+        local = false;
+
+        increaseCacheSize(1_000_000);

Review Comment:
   Test can become flaky if delete of such amount will be executed too fast. 
Let's use the same approach as for update (for example "WHERE sleep_func(?) > 0"



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to