tkalkirill commented on code in PR #1471:
URL: https://github.com/apache/ignite-3/pull/1471#discussion_r1057338320
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvPartitionStorage.java:
##########
@@ -537,9 +584,50 @@ public synchronized void clear() {
gcQueue.clear();
}
- private void checkClosed() {
+ private void checkStorageClosed() {
if (closed) {
throw new StorageClosedException("Storage is already closed");
}
}
+
+ private void checkStorageClosedOrInProcessFullRebalance() {
+ checkStorageClosed();
+
+ if (fullRebalance) {
+ throw new StorageFullRebalanceException("Storage in the process of
a full rebalancing");
+ }
+ }
+
+ void startFullRebalance() {
+ checkStorageClosed();
+
+ fullRebalance = true;
+
+ clear();
+
+ lastAppliedIndex = FULL_REBALANCE_IN_PROGRESS;
+ lastAppliedTerm = FULL_REBALANCE_IN_PROGRESS;
+ }
+
+ void abortFullRebalance() {
+ checkStorageClosed();
+
+ fullRebalance = false;
+
+ clear();
+
+ lastAppliedIndex = 0;
+ lastAppliedTerm = 0;
+ }
+
+ void finishFullRebalance(long lastAppliedIndex, long lastAppliedTerm) {
+ checkStorageClosed();
+
+ assert fullRebalance;
Review Comment:
Are you proposing to fail aborting a rebalance if it hasn't started yet?
--
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]