lowka commented on code in PR #2712:
URL: https://github.com/apache/ignite-3/pull/2712#discussion_r1399280255
##########
modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java:
##########
@@ -227,4 +266,64 @@ public Person(int id, String name, double salary) {
this.salary = salary;
}
}
+
+ /**
+ * Waits for some amount of time so that read-only transactions can
observe the most recent version of the catalog.
+ */
+ protected static void waitForReadTimestampThatObservesMostRecentCatalog()
{
+ // See TxManagerImpl::currentReadTimestamp.
+ long delay = HybridTimestamp.CLOCK_SKEW +
TestIgnitionManager.DEFAULT_PARTITION_IDLE_SYNC_TIME_INTERVAL_MS;
+ try {
+ TimeUnit.MILLISECONDS.sleep(delay);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static List<List<Object>> executeAwaitingIndexes(IgniteImpl node,
Function<IgniteImpl, List<List<Object>>> statement) {
+ CatalogManager catalogManager = node.catalogManager();
+
+ // Get existing indexes
+ Set<Integer> existing =
catalogManager.indexes(catalogManager.latestCatalogVersion())
+ .stream().map(CatalogObjectDescriptor::id)
+ .collect(Collectors.toSet());
+
+ List<List<Object>> result = statement.apply(node);
Review Comment:
This won't work. Because that makes all statements to wait additional 100+
ms.
--
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]