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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/FullStateTransferIndexChooser.java:
##########
@@ -238,21 +260,36 @@ private static List<Integer> 
mergeWithoutDuplicates(List<Integer> l0, List<Integ
     private void addListenersBusy() {
         catalogService.listen(INDEX_CREATE, 
fromConsumer(this::onIndexCreated));
         catalogService.listen(INDEX_REMOVED, 
fromConsumer(this::onIndexRemoved));
+
+        lowWatermark.addUpdateListener(this::onLwmChanged);
     }
 
     private void onIndexRemoved(RemoveIndexEventParameters parameters) {
         inBusyLock(busyLock, () -> {
             int indexId = parameters.indexId();
             int catalogVersion = parameters.catalogVersion();
 
-            CatalogIndexDescriptor index = indexBusy(indexId, catalogVersion - 
1);
+            lowWatermark.getLowWatermarkSafe(lwm -> {
+                int lwmCatalogVersion = 
catalogService.activeCatalogVersion(hybridTimestampToLong(lwm));
 
-            if (index.status() == AVAILABLE) {
-                // On drop table event.
-                readOnlyIndexes.add(new ReadOnlyIndexInfo(index, 
catalogActivationTimestampBusy(catalogVersion)));
-            } else if (index.status() == STOPPING) {
-                readOnlyIndexes.add(new ReadOnlyIndexInfo(index, 
findStoppingActivationTsBusy(indexId, catalogVersion - 1)));
-            }
+                if (catalogVersion <= lwmCatalogVersion) {

Review Comment:
   No, while an index is in `STOPPING`, it cannot be destroyed yet. But it can 
be destroyed if it's removed AND the moment of the switch to `STOPPING` (not of 
removal) is below LWM.
   
   I'm fine with just filing a ticket.



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