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


##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/MvTableStorage.java:
##########
@@ -162,4 +163,48 @@ default IndexStorage getOrCreateIndex(int partitionId, 
UUID indexId) {
      * @throws StorageException If an error has occurred during the 
destruction of the storage.
      */
     void destroy() throws StorageException;
+
+    /**
+     * Prepares the partition storage for rebalancing: makes a backup of the 
current partition storage and creates a new one.
+     *
+     * <p>This method must be called before each full rebalance of the 
partition storage, so that in case of errors or cancellation of the
+     * full rebalance, we can restore the partition storage from the backup.
+     *
+     * <p>Full rebalance will be completed when one of the methods is called:
+     * <ol>
+     *     <li>{@link #abortRebalanceMvPartition(int, Executor)} - in case of 
a full rebalance cancellation or failure, so that we can
+     *     restore the partition storage from a backup;</li>
+     *     <li>{@link #finishRebalanceMvPartition(int, Executor)} - in case of 
a successful full rebalance, to remove the backup of the
+     *     partition storage.</li>
+     * </ol>
+     *
+     * @param partitionId Partition ID.
+     * @param executor Executor.
+     * @return Future, if completed without errors, then {@link 
#getMvPartition} will return a new (empty) partition storage.
+     */
+    CompletableFuture<Void> startRebalanceMvPartition(int partitionId, 
Executor executor);
+
+    /**
+     * Aborts rebalancing of the partition storage if it was started: restores 
the partition storage from a backup and deletes the new one.
+     *
+     * <p>If a full rebalance has not {@link #startRebalanceMvPartition(int, 
Executor) started}, then nothing will happen.

Review Comment:
   Fix it



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