tkalkirill commented on code in PR #2783:
URL: https://github.com/apache/ignite-3/pull/2783#discussion_r1381626925
##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexAvailabilityController.java:
##########
@@ -130,6 +150,31 @@ public void close() {
busyLock.block();
}
+ /**
+ * Recovers index availability on node recovery.
+ *
+ * @param recoveryRevision Metastore revision on recovery.
+ * @return Future of recovery execution.
+ */
+ public CompletableFuture<Void> recover(long recoveryRevision) {
+ return inBusyLockAsync(busyLock, () -> {
+ // It is expected that the method will only be called on recovery,
when the deploy of metastore watches has not yet occurred.
+ int catalogVersion = catalogManager.latestCatalogVersion();
+
+ List<CompletableFuture<?>> futures =
catalogManager.indexes(catalogVersion).stream()
+ .map(indexDescriptor -> {
+ if (indexDescriptor.available()) {
+ return
recoveryForAvailableIndexBusy(indexDescriptor, recoveryRevision);
+ } else {
+ return
recoveryForRegisteredIndexBusy(indexDescriptor, recoveryRevision,
catalogVersion);
+ }
+ })
+ .collect(toList());
+
+ return allOf(futures.toArray(CompletableFuture[]::new));
Review Comment:
We discussed it personally and decided to try to do it without returning the
future.
--
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]