Skip to content
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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

Phillippko
Copy link
Contributor

Copy link
Contributor

@rpuch rpuch left a 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.

  1. It would be much better to use a single intent per group, not 2 per group
  2. 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.

@Phillippko Phillippko marked this pull request as ready for review January 17, 2025 08:04
Copy link
Contributor

@rpuch rpuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

@@ -1186,6 +1200,26 @@ public class IgniteImpl implements Ignite {
publicCatalog = new PublicApiThreadingIgniteCatalog(new IgniteCatalogSqlImpl(sql, distributedTblMgr), asyncContinuationExecutor);
}

private GroupStoragesContextResolver groupStoragesContextResolver() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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());
Copy link
Contributor

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

@rpuch
Copy link
Contributor

rpuch commented Jan 22, 2025

Oops, one thing that I forgot: please add tests for serializer (including a test for backward compatibility)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants