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


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/storage/state/TxStateStorage.java:
##########
@@ -194,4 +194,21 @@ public interface TxStateStorage extends ManuallyCloseable {
      *      has failed.
      */
     CompletableFuture<Void> finishRebalance(long lastAppliedIndex, long 
lastAppliedTerm);
+
+    /**
+     * Clears transaction state storage.
+     * <ul>
+     *     <li>Cancels all current operations (including cursors) with storage 
and waits for their completion;</li>
+     *     <li>Does not allow operations to be performed (exceptions will be 
thrown) with the storage until the cleaning is completed;</li>
+     *     <li>Clear storage;</li>
+     *     <li>Sets the {@link #lastAppliedIndex()}, {@link 
#lastAppliedTerm()} and {@link #persistedIndex()} to {@code 0};</li>
+     *     <li>Once the storage cleanup is complete (success or error), allows 
to perform all storage operations.</li>
+     * </ul>
+     *
+     * @return Future of transaction state storage cleanup.
+     * @throws IgniteInternalException with {@link 
Transactions#TX_STATE_STORAGE_STOPPED_ERR} if the storage is closed or 
destroyed.
+     * @throws IgniteInternalException with {@link 
Transactions#TX_STATE_STORAGE_REBALANCE_ERR} if the storage in process of 
rebalance.
+     * @throws IgniteInternalException with {@link 
Transactions#TX_STATE_STORAGE_ERR} if the storage in progress of cleanup or if 
failed.

Review Comment:
   fix



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