-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-23079 Make Raft storages destruction durable #4987
base: main
Are you sure you want to change the base?
Conversation
dfc7dd9
to
91a601e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice first attempt to approach the issue, but it seems to be more complicated than I thought before.
- It would be much better to use a single intent per group, not 2 per group
- Log storage factories should not be aware about destroying something on start (at least, at seems that we could avoid this). Current approach duplicates this logic in the log storage factories
How about trying to pull the knowledge about 'to which log storage factory to route the destruction request on start' higher (to raft server, for example?). We could introduce GroupStoragesDestructionIntent
with one method like toIntentIdBytes()
. For CMG and MS there would be one implementation (a class with just groupId in it); for partition it would be another implementation (with groupId and isVolatile
flag in it). We would then register resolvers with raft server; the resolvers would resolve intent ID bytes to GroupStorageDestructionIntents
and to the corresponding destroyers. Raft server would just iterate the destruction event storage, obtain destroyers and call them.
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Outdated
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Outdated
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/ignite/raft/jraft/storage/impl/VaultDestroyStorageIntentStorage.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/ignite/raft/jraft/storage/impl/VaultDestroyStorageIntentStorage.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/ignite/raft/jraft/storage/impl/VaultDestroyStorageIntentStorage.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/ignite/raft/jraft/storage/impl/VaultDestroyStorageIntentStorage.java
Outdated
Show resolved
Hide resolved
modules/vault/src/main/java/org/apache/ignite/internal/vault/VaultManager.java
Show resolved
Hide resolved
...t/src/main/java/org/apache/ignite/internal/raft/storage/GroupStoragesDestructionIntents.java
Show resolved
Hide resolved
...t/src/main/java/org/apache/ignite/internal/raft/storage/GroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/org/apache/ignite/internal/raft/storage/GroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/org/apache/ignite/internal/raft/storage/GroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/ignite/internal/raft/storage/impl/VaultGroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/ignite/internal/raft/storage/impl/VaultGroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/ignite/internal/raft/storage/impl/VaultGroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/ignite/internal/raft/storage/impl/VaultGroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/ignite/internal/raft/storage/impl/VaultGroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
# Conflicts: # modules/raft/build.gradle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
modules/core/src/main/java/org/apache/ignite/internal/replicator/PartitionGroupId.java
Outdated
Show resolved
Hide resolved
...rc/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java
Outdated
Show resolved
Hide resolved
modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItJraftDestructorTest.java
Outdated
Show resolved
Hide resolved
modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItJraftDestructorTest.java
Outdated
Show resolved
Hide resolved
modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/JraftAbstractTest.java
Outdated
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Outdated
Show resolved
Hide resolved
...s/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/DestroyStorageContext.java
Outdated
Show resolved
Hide resolved
...es/raft/src/main/java/org/apache/ignite/internal/raft/storage/impl/DestroyStorageIntent.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/ignite/internal/raft/storage/impl/VaultGroupStoragesDestructionIntents.java
Outdated
Show resolved
Hide resolved
@@ -1186,6 +1200,26 @@ public class IgniteImpl implements Ignite { | |||
publicCatalog = new PublicApiThreadingIgniteCatalog(new IgniteCatalogSqlImpl(sql, distributedTblMgr), asyncContinuationExecutor); | |||
} | |||
|
|||
private GroupStoragesContextResolver groupStoragesContextResolver() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private GroupStoragesContextResolver groupStoragesContextResolver() { | |
private GroupStoragesContextResolver createGroupStoragesContextResolver() { |
|
||
doThrow(LogStorageException.class).doCallRealMethod().when(logStorageFactory).destroyLogStorage(anyString()); | ||
// New log storage factory was created after restart. | ||
verify(logStorageFactories.get(SERVER_INDEX), times(0)).destroyLogStorage(anyString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is never()
that can be used instead of times(0)
. Up to you
Oops, one thing that I forgot: please add tests for serializer (including a test for backward compatibility) |
https://issues.apache.org/jira/browse/IGNITE-23079