tkalkirill commented on code in PR #3215:
URL: https://github.com/apache/ignite-3/pull/3215#discussion_r1492609169


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/FullStateTransferIndexChooser.java:
##########
@@ -274,30 +267,58 @@ private long catalogActivationTimestampBusy(int 
catalogVersion) {
         return catalog.time();
     }
 
-    private void recoveryReadOnlyIndexesBusy() {
+    private void recoverReadOnlyIndexesBusy() {
         int earliestCatalogVersion = catalogService.earliestCatalogVersion();
         int latestCatalogVersion = catalogService.latestCatalogVersion();
 
-        // At the moment, we will only use tables from the latest version (not 
dropped), since so far only replicas for them are started
-        // on the node.
-        int[] tableIds = 
catalogService.tables(latestCatalogVersion).stream().mapToInt(CatalogObjectDescriptor::id).toArray();
-
-        Map<Integer, ReadOnlyIndexInfo> readOnlyIndexes = new HashMap<>();
+        var readOnlyIndexById = new HashMap<Integer, ReadOnlyIndexInfo>();
+        var previousCatalogVersionTableIds = Set.<Integer>of();
 
         for (int catalogVersion = earliestCatalogVersion; catalogVersion <= 
latestCatalogVersion; catalogVersion++) {
-            Catalog catalog = catalogService.catalog(catalogVersion);
+            long activationTs = catalogActivationTimestampBusy(catalogVersion);
 
-            assert catalog != null : catalogVersion;
+            catalogService.indexes(catalogVersion).stream()
+                    .filter(index -> index.status() == STOPPING)
+                    .forEach(index -> 
readOnlyIndexById.computeIfAbsent(index.id(), i -> new ReadOnlyIndexInfo(index, 
activationTs)));

Review Comment:
   Add todos



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