tkalkirill commented on code in PR #1892:
URL: https://github.com/apache/ignite-3/pull/1892#discussion_r1161771835
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ClusterPerClassIntegrationTest.java:
##########
@@ -468,4 +475,45 @@ public static void waitForIndex(String indexName) throws
InterruptedException {
10_000)
);
}
+
+ /**
+ * Waits for the index to be built on all nodes.
+ *
+ * @param tableName Table name.
+ * @param indexName Index name.
+ * @throws Exception If failed.
+ */
+ public static void waitForIndexBuild(String tableName, String indexName)
throws Exception {
+ // TODO: IGNITE-18733 We are waiting for the synchronization of schemes
+ for (Ignite clusterNode : CLUSTER_NODES) {
+ CompletableFuture<Table> tableFuture =
clusterNode.tables().tableAsync(tableName);
+
+ assertThat(tableFuture, willCompleteSuccessfully());
+
+ TableImpl tableImpl = (TableImpl) tableFuture.join();
+
+ InternalTable internalTable = tableImpl.internalTable();
+
+ assertTrue(
+ waitForCondition(() -> getIndexConfiguration(clusterNode,
indexName) != null, 10, 10_000),
+ String.format("node=%s, tableName=%s, indexName=%s",
clusterNode.name(), tableName, indexName)
+ );
+
+ UUID indexId = getIndexConfiguration(clusterNode,
indexName).id().value();
+
+ for (int partitionId = 0; partitionId <
internalTable.partitions(); partitionId++) {
+ RaftGroupService raftGroupService =
internalTable.partitionRaftGroupService(partitionId);
+
+ Stream<Peer> allPeers =
Stream.concat(Stream.of(raftGroupService.leader()),
raftGroupService.peers().stream());
+
+ if
(allPeers.map(Peer::consistentId).noneMatch(clusterNode.name()::equals)) {
Review Comment:
Fix it.
--
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]