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


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/RocksDbClusterStateStorage.java:
##########
@@ -86,6 +87,13 @@ public RocksDbClusterStateStorage(Path dbPath, String 
nodeName) {
 
     @Override
     public CompletableFuture<Void> start() {
+        // delete existing data, relying on log playback
+        try {
+            RocksDB.destroyDB(dbPath.toString(), options);

Review Comment:
   Judging by the problem, I didn’t notice any of the proposed solutions, or am 
I looking in the wrong place?



##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/RocksDbClusterStateStorage.java:
##########
@@ -86,6 +87,13 @@ public RocksDbClusterStateStorage(Path dbPath, String 
nodeName) {
 
     @Override
     public CompletableFuture<Void> start() {
+        // delete existing data, relying on log playback
+        try {
+            RocksDB.destroyDB(dbPath.toString(), options);
+        } catch (RocksDBException e) {
+            return failedFuture(new CmgStorageException("Unable to drop 
RocksDb storage", e));
+        }
+
         init();

Review Comment:
   This is where it doesn’t work out well, because init() throws an 
`CmgStorageException`, but the `return failedFuture` should be, please fix it.



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -963,6 +963,27 @@ public void metastorageRecoveryTest(boolean useSnapshot) 
throws InterruptedExcep
         }
     }
 
+    /**
+     * Checks that logical topology version is maintained after nodes restart.
+     */
+    @Test
+    public void logicalTopologyVersionMaintainedTest() {
+        IgniteImpl main = startNodes(3).get(0);
+
+        stopNode(1);
+        IgniteImpl restarted = startNode(1);
+
+        stopNode(2);
+        IgniteImpl secondRestarted = startNode(2);
+
+        long mainVersion = 
main.logicalTopologyService().localLogicalTopology().version();
+        long restartedVersion = 
restarted.logicalTopologyService().localLogicalTopology().version();
+        long secondRestartedVersion = 
secondRestarted.logicalTopologyService().localLogicalTopology().version();
+
+        assertEquals(mainVersion, restartedVersion);
+        assertEquals(mainVersion, secondRestartedVersion);

Review Comment:
   I don’t understand what and why you are checking?



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