rpuch commented on code in PR #6693:
URL: https://github.com/apache/ignite-3/pull/6693#discussion_r2402076170


##########
modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java:
##########
@@ -230,19 +380,19 @@ private static void createAndPopulateTable(int replicas, 
int partitions) {
                 "CREATE TABLE {} (i0 INTEGER PRIMARY KEY, i1 INTEGER) ZONE {}",
                 TABLE_NAME, ZONE_NAME
         ));
-
-        sql(format(
-                "INSERT INTO {} VALUES {}",
-                TABLE_NAME, toValuesString(List.of(1, 1), List.of(2, 2), 
List.of(3, 3), List.of(4, 4), List.of(5, 5))
-        ));
     }
 
-    private static void createIndex(String indexName) throws Exception {
+    private void createIndex(String indexName) throws Exception {
         // We execute this operation asynchronously, because some tests block 
network messages, which makes the underlying code
         // stuck with timeouts. We don't need to wait for the operation to 
complete, as we wait for the necessary invariants further
         // below.
         CLUSTER.aliveNode().sql()
-                .executeAsync(null, format("CREATE INDEX {} ON {} (i1)", 
indexName, TABLE_NAME));
+                .executeAsync(null, format("CREATE INDEX {} ON {} (i1)", 
indexName, TABLE_NAME))
+                .whenComplete((res, ex) -> {
+                    if (ex != null) {
+                        log.error("Failed to create index", ex);

Review Comment:
   Normally, you would just wait for future and analyze its result. But in this 
case this can't be done as we can't 'block' on the future (the comment explains 
why). So, if for some reason there is a problem with the index creation SQL 
(like referencing an unused column), we'll not get any information about the 
problem.
   
   Addition of logging here is an attempt to make it easier to find 'why the 
hell the index does not appear' :) It's unconventional, but it is better than 
nothing.
   
   Also, if someone adds a logger field, it will most probably be a static 
`LOG`, so no clash.



-- 
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