This is an automated email from the ASF dual-hosted git repository.

rpuch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new f4b2384f81 IGNITE-23530 Do not include node name in Raft group 
identifier in storages (#4625)
f4b2384f81 is described below

commit f4b2384f8152b294221e3cb7a537dcc6b1fb22a6
Author: Roman Puchkovskiy <[email protected]>
AuthorDate: Fri Oct 25 20:25:23 2024 +0400

    IGNITE-23530 Do not include node name in Raft group identifier in storages 
(#4625)
---
 .../apache/ignite/internal/raft/ItLozaTest.java    |  2 +-
 .../internal/raft/server/impl/JraftServerImpl.java | 17 ++----
 .../storage/impl/DefaultLogStorageFactory.java     | 16 +++--
 .../raft/storage/impl/RocksDbSharedLogStorage.java | 68 +++++++++++-----------
 .../storage/impl/RocksDbSharedLogStorageUtils.java | 16 ++---
 .../raft/storage/impl/RocksDbSpillout.java         | 56 +++++++++---------
 .../storage/impl/VolatileLogStorageFactory.java    | 10 ++--
 7 files changed, 93 insertions(+), 92 deletions(-)

diff --git 
a/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLozaTest.java
 
b/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLozaTest.java
index b248cd9259..11bedfe2a7 100644
--- 
a/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLozaTest.java
+++ 
b/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLozaTest.java
@@ -344,7 +344,7 @@ public class ItLozaTest extends IgniteAbstractTest {
 
         loza.stopRaftNodes(replicationGroupId);
 
-        String groupUri = nodeId.groupId().toString() + "_" + 
nodeId.peer().consistentId() + "_" + nodeId.peer().idx();
+        String groupUri = nodeId.groupId().toString() + "-" + 
nodeId.peer().idx();
         Path groupRaftStoragesPath = 
partitionsWorkDir.metaPath().resolve(groupUri);
 
         assertTrue(Files.isDirectory(groupRaftStoragesPath));
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
index 276ce75327..fd9be88b35 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
@@ -410,16 +410,11 @@ public class JraftServerImpl implements RaftServer {
     }
 
     public static Path getServerDataPath(Path basePath, RaftNodeId nodeId) {
-        return basePath.resolve(nodeIdStr(nodeId));
+        return basePath.resolve(nodeIdStrForStorage(nodeId));
     }
 
-    private static String nodeIdStr(RaftNodeId nodeId) {
-        return String.join(
-                "_",
-                nodeId.groupId().toString(),
-                nodeId.peer().consistentId(),
-                String.valueOf(nodeId.peer().idx())
-        );
+    private static String nodeIdStrForStorage(RaftNodeId nodeId) {
+        return nodeId.groupId().toString() + "-" + nodeId.peer().idx();
     }
 
     @Override
@@ -456,7 +451,7 @@ public class JraftServerImpl implements RaftServer {
             // Thread pools are shared by all raft groups.
             NodeOptions nodeOptions = opts.copy();
 
-            nodeOptions.setLogUri(nodeIdStr(nodeId));
+            nodeOptions.setLogUri(nodeIdStrForStorage(nodeId));
 
             Path serverDataPath = serverDataPathForNodeId(nodeId, 
groupOptions);
 
@@ -571,8 +566,8 @@ public class JraftServerImpl implements RaftServer {
     public void destroyRaftNodeStorages(RaftNodeId nodeId, RaftGroupOptions 
groupOptions) {
         // TODO: IGNITE-23079 - improve on what we do if it was not possible 
to destroy any of the storages.
         try {
-            String uri = nodeIdStr(nodeId);
-            groupOptions.getLogStorageFactory().destroyLogStorage(uri);
+            String logUri = nodeIdStrForStorage(nodeId);
+            groupOptions.getLogStorageFactory().destroyLogStorage(logUri);
         } finally {
             Path serverDataPath = serverDataPathForNodeId(nodeId, 
groupOptions);
 
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/DefaultLogStorageFactory.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/DefaultLogStorageFactory.java
index bd50153e60..aa5e71b52a 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/DefaultLogStorageFactory.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/DefaultLogStorageFactory.java
@@ -19,8 +19,8 @@ package org.apache.ignite.internal.raft.storage.impl;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.concurrent.CompletableFuture.failedFuture;
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupEndPrefix;
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupStartPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageEndPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageStartPrefix;
 import static 
org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture;
 import static org.rocksdb.RocksDB.DEFAULT_COLUMN_FAMILY;
 
@@ -219,16 +219,22 @@ public class DefaultLogStorageFactory implements 
LogStorageFactory {
     }
 
     @Override
-    public LogStorage createLogStorage(String groupId, RaftOptions 
raftOptions) {
+    public LogStorage createLogStorage(String raftNodeStorageId, RaftOptions 
raftOptions) {
         // raftOptions is ignored as fsync status is passed via dbOptions.
 
-        return new RocksDbSharedLogStorage(this, db, confHandle, dataHandle, 
groupId, writeOptions, executorService);
+        return new RocksDbSharedLogStorage(this, db, confHandle, dataHandle, 
raftNodeStorageId, writeOptions, executorService);
     }
 
     @Override
     public void destroyLogStorage(String uri) {
         try {
-            RocksDbSharedLogStorage.destroyAllEntriesBetween(db, confHandle, 
dataHandle, groupStartPrefix(uri), groupEndPrefix(uri));
+            RocksDbSharedLogStorage.destroyAllEntriesBetween(
+                    db,
+                    confHandle,
+                    dataHandle,
+                    raftNodeStorageStartPrefix(uri),
+                    raftNodeStorageEndPrefix(uri)
+            );
         } catch (RocksDBException e) {
             throw new LogStorageException("Fail to destroy the log storage for 
" + uri, e);
         }
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorage.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorage.java
index 20e250be78..ef025cc642 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorage.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorage.java
@@ -18,8 +18,8 @@
 package org.apache.ignite.internal.raft.storage.impl;
 
 import static java.util.Arrays.copyOfRange;
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupEndPrefix;
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupStartPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageEndPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageStartPrefix;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
@@ -58,7 +58,7 @@ import org.rocksdb.WriteOptions;
 
 /**
  * Log storage that shares rocksdb instance with other log storages.
- * Stores key with groupId prefix to distinguish them from keys that belongs 
to other storages.
+ * Stores key with raft node storage ID prefix to distinguish them from keys 
that belongs to other storages.
  */
 public class RocksDbSharedLogStorage implements LogStorage, Describer {
     /** Logger. */
@@ -98,16 +98,16 @@ public class RocksDbSharedLogStorage implements LogStorage, 
Describer {
     private final WriteOptions writeOptions;
 
     /** Start prefix. */
-    private final byte[] groupStartPrefix;
+    private final byte[] startPrefix;
 
     /** End prefix. */
-    private final byte[] groupEndPrefix;
+    private final byte[] endPrefix;
 
-    /** Raft group start bound. */
-    private final Slice groupStartBound;
+    /** Raft node start bound. */
+    private final Slice startBound;
 
-    /** Raft group end bound. */
-    private final Slice groupEndBound;
+    /** Raft node end bound. */
+    private final Slice endBound;
 
     /** RW lock. */
     private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
@@ -142,7 +142,7 @@ public class RocksDbSharedLogStorage implements LogStorage, 
Describer {
             RocksDB db,
             ColumnFamilyHandle confHandle,
             ColumnFamilyHandle dataHandle,
-            String groupId,
+            String raftNodeStorageId,
             WriteOptions writeOptions,
             Executor executor
     ) {
@@ -152,12 +152,12 @@ public class RocksDbSharedLogStorage implements 
LogStorage, Describer {
         Requires.requireNonNull(executor);
 
         Requires.requireTrue(
-                groupId.indexOf(0) == -1,
-                "Raft group id " + groupId + " must not contain char(0)"
+                raftNodeStorageId.indexOf(0) == -1,
+                "Raft node storage id " + raftNodeStorageId + " must not 
contain char(0)"
         );
         Requires.requireTrue(
-                groupId.indexOf(1) == -1,
-                "Raft group id " + groupId + " must not contain char(1)"
+                raftNodeStorageId.indexOf(1) == -1,
+                "Raft node storage id " + raftNodeStorageId + " must not 
contain char(1)"
         );
 
         this.logStorageFactory = logStorageFactory;
@@ -165,10 +165,10 @@ public class RocksDbSharedLogStorage implements 
LogStorage, Describer {
         this.confHandle = confHandle;
         this.dataHandle = dataHandle;
         this.executor = executor;
-        this.groupStartPrefix = groupStartPrefix(groupId);
-        this.groupEndPrefix = groupEndPrefix(groupId);
-        this.groupStartBound = new Slice(groupStartPrefix);
-        this.groupEndBound = new Slice(groupEndPrefix);
+        this.startPrefix = raftNodeStorageStartPrefix(raftNodeStorageId);
+        this.endPrefix = raftNodeStorageEndPrefix(raftNodeStorageId);
+        this.startBound = new Slice(startPrefix);
+        this.endBound = new Slice(endPrefix);
         this.writeOptions = writeOptions;
     }
 
@@ -206,10 +206,10 @@ public class RocksDbSharedLogStorage implements 
LogStorage, Describer {
 
     private void load(ConfigurationManager confManager) {
         try (
-                var readOptions = new 
ReadOptions().setIterateUpperBound(groupEndBound);
+                var readOptions = new 
ReadOptions().setIterateUpperBound(endBound);
                 RocksIterator it = this.db.newIterator(this.confHandle, 
readOptions)
         ) {
-            it.seek(groupStartPrefix);
+            it.seek(startPrefix);
             while (it.isValid()) {
                 byte[] keyWithPrefix = it.key();
                 byte[] ks = getKey(keyWithPrefix);
@@ -252,7 +252,7 @@ public class RocksDbSharedLogStorage implements LogStorage, 
Describer {
     }
 
     private byte[] getKey(byte[] ks) {
-        return copyOfRange(ks, groupStartPrefix.length, ks.length);
+        return copyOfRange(ks, startPrefix.length, ks.length);
     }
 
     private void setFirstLogIndex(long index) {
@@ -307,10 +307,10 @@ public class RocksDbSharedLogStorage implements 
LogStorage, Describer {
             }
 
             try (
-                    var readOptions = new 
ReadOptions().setIterateUpperBound(groupEndBound);
+                    var readOptions = new 
ReadOptions().setIterateUpperBound(endBound);
                     RocksIterator it = this.db.newIterator(this.dataHandle, 
readOptions)
             ) {
-                it.seek(groupStartPrefix);
+                it.seek(startPrefix);
 
                 if (it.isValid()) {
                     byte[] key = getKey(it.key());
@@ -333,10 +333,10 @@ public class RocksDbSharedLogStorage implements 
LogStorage, Describer {
         this.useLock.lock();
 
         try (
-                var readOptions = new 
ReadOptions().setIterateLowerBound(groupStartBound);
+                var readOptions = new 
ReadOptions().setIterateLowerBound(startBound);
                 RocksIterator it = this.db.newIterator(this.dataHandle, 
readOptions)
         ) {
-            it.seekForPrev(groupEndPrefix);
+            it.seekForPrev(endPrefix);
 
             if (it.isValid()) {
                 byte[] key = getKey(it.key());
@@ -539,7 +539,7 @@ public class RocksDbSharedLogStorage implements LogStorage, 
Describer {
 
         try {
             LogEntry entry = getEntry(nextLogIndex);
-            destroyAllEntriesBetween(db, confHandle, dataHandle, 
groupStartPrefix, groupEndPrefix);
+            destroyAllEntriesBetween(db, confHandle, dataHandle, startPrefix, 
endPrefix);
 
             onReset(nextLogIndex);
 
@@ -664,24 +664,24 @@ public class RocksDbSharedLogStorage implements 
LogStorage, Describer {
      * Called upon closing the storage.
      */
     protected void onShutdown() {
-        groupEndBound.close();
-        groupStartBound.close();
+        endBound.close();
+        startBound.close();
     }
 
     @SuppressWarnings("SameParameterValue")
     private byte[] createKey(byte[] key) {
-        var buffer = new byte[groupStartPrefix.length + key.length];
+        var buffer = new byte[startPrefix.length + key.length];
 
-        System.arraycopy(groupStartPrefix, 0, buffer, 0, 
groupStartPrefix.length);
-        System.arraycopy(key, 0, buffer, groupStartPrefix.length, key.length);
+        System.arraycopy(startPrefix, 0, buffer, 0, startPrefix.length);
+        System.arraycopy(key, 0, buffer, startPrefix.length, key.length);
 
         return buffer;
     }
 
     private byte[] createKey(long index) {
-        byte[] ks = new byte[groupStartPrefix.length + Long.BYTES];
-        System.arraycopy(groupStartPrefix, 0, ks, 0, groupStartPrefix.length);
-        LONG_ARRAY_HANDLE.set(ks, groupStartPrefix.length, index);
+        byte[] ks = new byte[startPrefix.length + Long.BYTES];
+        System.arraycopy(startPrefix, 0, ks, 0, startPrefix.length);
+        LONG_ARRAY_HANDLE.set(ks, startPrefix.length, index);
         return ks;
     }
 
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorageUtils.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorageUtils.java
index 79b1c3ca20..79c5bce2d9 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorageUtils.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSharedLogStorageUtils.java
@@ -21,20 +21,20 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 
 class RocksDbSharedLogStorageUtils {
     /**
-     * Returns start prefix for the group.
+     * Returns start prefix for the raft node.
      *
-     * @param groupId ID of the group.
+     * @param raftNodeStorageId ID of the raft node storage.
      */
-    static byte[] groupStartPrefix(String groupId) {
-        return (groupId + (char) 0).getBytes(UTF_8);
+    static byte[] raftNodeStorageStartPrefix(String raftNodeStorageId) {
+        return (raftNodeStorageId + (char) 0).getBytes(UTF_8);
     }
 
     /**
-     * Returns end prefix for the group.
+     * Returns end prefix for the raft node.
      *
-     * @param groupId ID of the group.
+     * @param raftNodeStorageId ID of the raft node storage.
      */
-    static byte[] groupEndPrefix(String groupId) {
-        return (groupId + (char) 1).getBytes(UTF_8);
+    static byte[] raftNodeStorageEndPrefix(String raftNodeStorageId) {
+        return (raftNodeStorageId + (char) 1).getBytes(UTF_8);
     }
 }
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSpillout.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSpillout.java
index 9a4c22b2dc..ca975daa80 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSpillout.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/RocksDbSpillout.java
@@ -17,8 +17,8 @@
 
 package org.apache.ignite.internal.raft.storage.impl;
 
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupEndPrefix;
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupStartPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageEndPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageStartPrefix;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
@@ -48,7 +48,7 @@ import org.rocksdb.WriteOptions;
 /**
  * {@link Logs} implementation that stores logs spilt out to disk in RocksDB. 
It shares rocksdb instance with other similar instances.
  *
- * <p>Stores key with groupId prefix to distinguish them from keys that 
belongs to other storages.
+ * <p>Stores key with raft node storage ID prefix to distinguish them from 
keys that belongs to other storages.
  *
  * <p>The data stored by this class is treated as volatile. No flush is done; 
when the Ignite instance is restarted,
  * the contents of the corresponding RocksDB database should be erased.
@@ -80,16 +80,16 @@ public class RocksDbSpillout implements Logs {
     private final WriteOptions writeOptions;
 
     /** Start prefix. */
-    private final byte[] groupStartPrefix;
+    private final byte[] startPrefix;
 
     /** End prefix. */
-    private final byte[] groupEndPrefix;
+    private final byte[] endPrefix;
 
-    /** Raft group start bound. */
-    private final Slice groupStartBound;
+    /** Raft node start bound. */
+    private final Slice startBound;
 
-    /** Raft group end bound. */
-    private final Slice groupEndBound;
+    /** Raft node end bound. */
+    private final Slice endBound;
 
     /** RW lock. */
     private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
@@ -121,7 +121,7 @@ public class RocksDbSpillout implements Logs {
     public RocksDbSpillout(
             RocksDB db,
             ColumnFamilyHandle columnFamily,
-            String groupId,
+            String raftNodeStorageId,
             Executor executor
     ) {
         Requires.requireNonNull(db);
@@ -129,21 +129,21 @@ public class RocksDbSpillout implements Logs {
         Requires.requireNonNull(executor);
 
         Requires.requireTrue(
-                groupId.indexOf(0) == -1,
-                "Raft group id " + groupId + " must not contain char(0)"
+                raftNodeStorageId.indexOf(0) == -1,
+                "Raft node storage id " + raftNodeStorageId + " must not 
contain char(0)"
         );
         Requires.requireTrue(
-                groupId.indexOf(1) == -1,
-                "Raft group id " + groupId + " must not contain char(1)"
+                raftNodeStorageId.indexOf(1) == -1,
+                "Raft node storage id " + raftNodeStorageId + " must not 
contain char(1)"
         );
 
         this.db = db;
         this.columnFamily = columnFamily;
         this.executor = executor;
-        this.groupStartPrefix = groupStartPrefix(groupId);
-        this.groupEndPrefix = groupEndPrefix(groupId);
-        this.groupStartBound = new Slice(groupStartPrefix);
-        this.groupEndBound = new Slice(groupEndPrefix);
+        this.startPrefix = raftNodeStorageStartPrefix(raftNodeStorageId);
+        this.endPrefix = raftNodeStorageEndPrefix(raftNodeStorageId);
+        this.startBound = new Slice(startPrefix);
+        this.endBound = new Slice(endPrefix);
 
         this.writeOptions = new WriteOptions();
         this.writeOptions.setDisableWAL(true);
@@ -191,11 +191,11 @@ public class RocksDbSpillout implements Logs {
 
             stopped = true;
 
-            deleteWholeGroupRange();
+            deleteWholeRaftNodeRange();
 
             closeResources();
         } catch (RocksDBException e) {
-            throw new LogStorageException("Cannot remove group keys", e);
+            throw new LogStorageException("Cannot remove raft node keys", e);
         } finally {
             this.manageLock.unlock();
         }
@@ -286,7 +286,7 @@ public class RocksDbSpillout implements Logs {
         this.manageLock.lock();
 
         try {
-            deleteWholeGroupRange();
+            deleteWholeRaftNodeRange();
         } catch (RocksDBException e) {
             LOG.error("Fail to reset next log index.", e);
             throw new LogStorageException("Fail to reset next log index.", e);
@@ -297,8 +297,8 @@ public class RocksDbSpillout implements Logs {
         doInit();
     }
 
-    private void deleteWholeGroupRange() throws RocksDBException {
-        deleteAllEntriesBetween(db, columnFamily, groupStartPrefix, 
groupEndPrefix);
+    private void deleteWholeRaftNodeRange() throws RocksDBException {
+        deleteAllEntriesBetween(db, columnFamily, startPrefix, endPrefix);
     }
 
     /**
@@ -386,14 +386,14 @@ public class RocksDbSpillout implements Logs {
      */
     private void closeResources() {
         writeOptions.close();
-        groupEndBound.close();
-        groupStartBound.close();
+        endBound.close();
+        startBound.close();
     }
 
     private byte[] createKey(long index) {
-        byte[] ks = new byte[groupStartPrefix.length + Long.BYTES];
-        System.arraycopy(groupStartPrefix, 0, ks, 0, groupStartPrefix.length);
-        LONG_ARRAY_HANDLE.set(ks, groupStartPrefix.length, index);
+        byte[] ks = new byte[startPrefix.length + Long.BYTES];
+        System.arraycopy(startPrefix, 0, ks, 0, startPrefix.length);
+        LONG_ARRAY_HANDLE.set(ks, startPrefix.length, index);
         return ks;
     }
 
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/VolatileLogStorageFactory.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/VolatileLogStorageFactory.java
index 2765ff4caf..51d76fc387 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/VolatileLogStorageFactory.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/VolatileLogStorageFactory.java
@@ -17,8 +17,8 @@
 
 package org.apache.ignite.internal.raft.storage.impl;
 
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupEndPrefix;
-import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.groupStartPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageEndPrefix;
+import static 
org.apache.ignite.internal.raft.storage.impl.RocksDbSharedLogStorageUtils.raftNodeStorageStartPrefix;
 import static 
org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture;
 
 import java.util.HashMap;
@@ -112,15 +112,15 @@ public class VolatileLogStorageFactory implements 
LogStorageFactory {
 
     /** {@inheritDoc} */
     @Override
-    public LogStorage createLogStorage(String groupId, RaftOptions 
raftOptions) {
-        RocksDbSpillout spiltOnDisk = new RocksDbSpillout(db, columnFamily, 
groupId, executor);
+    public LogStorage createLogStorage(String raftNodeStorageId, RaftOptions 
raftOptions) {
+        RocksDbSpillout spiltOnDisk = new RocksDbSpillout(db, columnFamily, 
raftNodeStorageId, executor);
         return new VolatileLogStorage(createLogStorageBudget(), new 
OnHeapLogs(), spiltOnDisk);
     }
 
     @Override
     public void destroyLogStorage(String uri) {
         try {
-            RocksDbSpillout.deleteAllEntriesBetween(db, columnFamily, 
groupStartPrefix(uri), groupEndPrefix(uri));
+            RocksDbSpillout.deleteAllEntriesBetween(db, columnFamily, 
raftNodeStorageStartPrefix(uri), raftNodeStorageEndPrefix(uri));
         } catch (RocksDBException e) {
             throw new LogStorageException("Fail to destroy the log storage 
spillout for " + uri, e);
         }

Reply via email to