kgusakov commented on code in PR #4843:
URL: https://github.com/apache/ignite-3/pull/4843#discussion_r1890157783


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/DisasterRecoveryManager.java:
##########
@@ -569,26 +605,64 @@ private static Collection<CatalogZoneDescriptor> 
filterZones(Set<String> zoneNam
         return zoneDescriptors;
     }
 
+    private CompletableFuture<Void> processNewRequest(DisasterRecoveryRequest 
request) {
+        return processNewRequest(request, -1);
+    }
+
     /**
      * Creates new operation future, associated with the request, and writes 
it into meta-storage.
      *
      * @param request Request.
+     * @param revision Revision of event, which produce this recovery request.
      * @return Operation future.
      */
-    private CompletableFuture<Void> processNewRequest(DisasterRecoveryRequest 
request) {
+    private CompletableFuture<Void> processNewRequest(DisasterRecoveryRequest 
request, long revision) {
         UUID operationId = request.operationId();
 
         CompletableFuture<Void> operationFuture = new CompletableFuture<Void>()
                 .whenComplete((v, throwable) -> 
ongoingOperationsById.remove(operationId))
                 .orTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS);
 
+        byte[] serializedRequest = VersionedSerialization.toBytes(request, 
DisasterRecoveryRequestSerializer.INSTANCE);
+
         ongoingOperationsById.put(operationId, operationFuture);
 
-        metaStorageManager.put(RECOVERY_TRIGGER_KEY, 
VersionedSerialization.toBytes(request, 
DisasterRecoveryRequestSerializer.INSTANCE));
+        if (revision != -1) {
+            putRecoveryTriggerIfRevisionIsNotProcessed(
+                    request.zoneId(),
+                    longToBytesKeepingOrder(revision),
+                    serializedRequest,
+                    operationId
+            );
+        } else {

Review Comment:
   Added



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to