AMashenkov commented on code in PR #3358:
URL: https://github.com/apache/ignite-3/pull/3358#discussion_r1521536188


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTracker.java:
##########
@@ -304,9 +331,22 @@ private CompletableFuture<Boolean> 
notifyInternal(EventParameters parameters) {
         return falseCompletedFuture(); // false: don't remove listener.
     }
 
-    private void removeTable(DestroyTableEventParameters event) {
-        for (int partition = 0; partition < event.partitions(); partition++) {
-            TablePartitionId tablePartitionId = new 
TablePartitionId(event.tableId(), partition);
+    @Override
+    public CompletableFuture<Void> onLwmChanged(HybridTimestamp ts) {
+        return inBusyLockAsync(busyLock, () -> {
+            int earliestVersion = 
catalogService.earliestCatalogVersion(HybridTimestamp.hybridTimestampToLong(ts));
+
+            List<DestroyTableEvent> events = 
deferredEventsQueue.drainUpTo(earliestVersion);
+
+            events.forEach(event -> removeTable(event.tableId(), 
event.partitions()));
+
+            return nullCompletedFuture();
+        });
+    }
+
+    private void removeTable(int tableId, int partitions) {
+        for (int partition = 0; partition < partitions; partition++) {
+            TablePartitionId tablePartitionId = new TablePartitionId(tableId, 
partition);
             primaryReplicas.remove(tablePartitionId);

Review Comment:
   Yep.



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