AMashenkov commented on code in PR #1754:
URL: https://github.com/apache/ignite-3/pull/1754#discussion_r1132430676


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -663,6 +665,68 @@ public void emptyNodeTest() {
         assertEquals(DEFAULT_NODE_PORT, nodePort);
     }
 
+    /**
+     * Check correctness of return results after node restart.
+     * Scenario:
+     * <ol>
+     *     <li>Start two nodes and fill the data.</li>
+     *     <li>Create index.</li>
+     *     <li>Check explain contain index scan.</li>
+     *     <li>Check return results.</li>
+     *     <li>Restart one node.</li>
+     *     <li>Run query and compare results.</li>
+     * </ol>
+     */
+    @Test
+    public void testQueryCorrectnessAfterNodeRestart() throws 
InterruptedException {
+        IgniteImpl ignite1 = startNode(0);
+
+        createTableWithoutData(ignite1, TABLE_NAME, 2, 1);
+
+        IgniteImpl ignite2 = startNode(1);
+
+        String sql = "SELECT id FROM " + TABLE_NAME + " WHERE id > 0 ORDER BY 
id";
+
+        int intRes;
+
+        try (Session session1 = ignite1.sql().createSession(); Session 
session2 = ignite2.sql().createSession()) {
+            session1.execute(null, "CREATE INDEX idx1 ON " + TABLE_NAME + 
"(id)");
+
+            waitForIndex(List.of(ignite1, ignite2), "idx1");
+
+            createTableWithData(List.of(ignite1), TABLE_NAME, 2, 1);
+
+            ResultSet<SqlRow> plan = session1.execute(null, "EXPLAIN PLAN FOR 
" + sql);
+
+            String planStr = plan.next().stringValue(0);
+
+            assertTrue(planStr.contains("IndexScan"));
+
+            ResultSet<SqlRow> res1 = session1.execute(null, sql);
+
+            ResultSet<SqlRow> res2 = session2.execute(null, sql);
+
+            intRes = res1.next().intValue(0);
+
+            assertEquals(intRes, res2.next().intValue(0));
+
+            res1.close();
+
+            res2.close();
+        }
+
+        // Uncomment after IGNITE-18203

Review Comment:
   ```suggestion
           //TODO Uncomment after IGNITE-18203
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to