You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2025/02/21 10:39:40 UTC

[PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

zstan opened a new pull request, #5264:
URL: https://github.com/apache/ignite-3/pull/5264

   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969430391


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {

Review Comment:
   It looks like this fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages
   
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               System.out.println(rs.getInt(1));
           }
       }



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969430391


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {

Review Comment:
   It looks like this fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages
   
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               // no-op.
           }
       }



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969402140


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {
+            scriptTxContext.onError(txEx);
+
+            cursorFuture.completeExceptionally(txEx);
+
+            scriptStatement.cursorFuture.completeExceptionally(new SqlException(

Review Comment:
   Isn't `cursorFuture` the same as the `scriptStatement.cursorFuture`?
   



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {
+            scriptTxContext.onError(txEx);
+
+            cursorFuture.completeExceptionally(txEx);
+
+            scriptStatement.cursorFuture.completeExceptionally(new SqlException(

Review Comment:
   It looks like this fix fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable, I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages
   
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               System.out.println(rs.getInt(1));
           }
       }



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan commented on PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#issuecomment-2674567448

   @xtern can you take a look plz ?


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan merged PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969425724


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {
+            scriptTxContext.onError(txEx);
+
+            cursorFuture.completeExceptionally(txEx);
+
+            scriptStatement.cursorFuture.completeExceptionally(new SqlException(

Review Comment:
   It looks like this fix fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages
   
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               System.out.println(rs.getInt(1));
           }
       }



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969430391


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {

Review Comment:
   It looks like this fix fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages
   
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               System.out.println(rs.getInt(1));
           }
       }



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969430391


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {

Review Comment:
   It looks like this fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages, something like that
   ```java
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               // no-op.
           }
       }
   ```
   
   what do you think?



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {
+            scriptTxContext.onError(txEx);
+
+            cursorFuture.completeExceptionally(txEx);
+
+            scriptStatement.cursorFuture.completeExceptionally(new SqlException(

Review Comment:
   Isn't `cursorFuture` the same thing as the `scriptStatement.cursorFuture`?
   



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969430391


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {

Review Comment:
   It looks like this fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages, something like that
   ```java
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               // no-op.
           }
       }
   ```
       what do you think?



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-24483 Sql. ItJdbcMultiStatementSelfTest.testAutoCommitFalseTxControlStatementsNotSupported is flaky [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969425724


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> processNext() {
                             });
                 }
             });
+        } catch (TxControlInsideExternalTxNotSupportedException txEx) {
+            scriptTxContext.onError(txEx);
+
+            cursorFuture.completeExceptionally(txEx);
+
+            scriptStatement.cursorFuture.completeExceptionally(new SqlException(

Review Comment:
   It looks like this fix fixes the problem with handling `TxControlInsideExternalTxNotSupportedException` (but we still need to open a ticket to think about what to do with similar cases, for example select ..; insert .. 1/0).
   
   If it is decided that this fix is ​​suitable (for me it looks good), I would recommend changing the test so that it immediately fails if the behavior changes.
   
   e.g. instead of "SELECT 1; COMMIT"
   read several pages
   
       boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0, 10000));COMMIT");
       assertTrue(res);
       assertNotNull(stmt.getResultSet());
       try (ResultSet rs = stmt.getResultSet()) {
           while (rs.next()) {
               System.out.println(rs.getInt(1));
           }
       }



-- 
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-unsubscribe@ignite.apache.org

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