-
Notifications
You must be signed in to change notification settings - Fork 93
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-19227 Wait for schema availability outside JRaft threads #2450
Conversation
e7595d9
to
25ccaf4
Compare
modules/core/src/main/java/org/apache/ignite/internal/util/VarIntUtils.java
Show resolved
Hide resolved
|
||
String delayDurationPath = "schemaSync.delayDuration"; | ||
configDocument = applyTestDefault( |
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's no way to override this value, right?
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.
I wish we would be able to get configuration from annotations, but that's for the future
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.
It's marked @Immutable
in the configuration, so there should not be any way to override it yet
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.
I mean, what if subclass wants to have its own value?
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.
If someone wants to run a cluster with a different value of some cluster-wide config property, they would use TestIgnitionManager#init()
passing the config they need. The code we are looking at now is about DEFAULT values used if no explicit value was supplied when initializing the cluster.
modules/raft/src/main/java/org/apache/ignite/internal/raft/util/OptimizedMarshaller.java
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/impl/ActionRequestProcessor.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
Show resolved
Hide resolved
...rc/main/java/org/apache/ignite/internal/table/distributed/replicator/action/RequestType.java
Outdated
Show resolved
Hide resolved
.../org/apache/ignite/internal/table/distributed/schema/CheckCatalogVersionOnAppendEntries.java
Outdated
Show resolved
Hide resolved
...ava/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImpl.java
Outdated
Show resolved
Hide resolved
...org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImplTest.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/util/VarIntUtils.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/util/VarIntUtils.java
Outdated
Show resolved
Hide resolved
modules/core/src/test/java/org/apache/ignite/internal/util/VarIntUtilsTest.java
Outdated
Show resolved
Hide resolved
modules/core/src/test/java/org/apache/ignite/internal/util/VarIntUtilsTest.java
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
Show resolved
Hide resolved
.../org/apache/ignite/internal/table/distributed/schema/CheckCatalogVersionOnAppendEntries.java
Outdated
Show resolved
Hide resolved
.../apache/ignite/internal/table/distributed/schema/ThreadLocalPartitionCommandsMarshaller.java
Outdated
Show resolved
Hide resolved
...a/org/apache/ignite/internal/table/distributed/replication/PartitionReplicaListenerTest.java
Outdated
Show resolved
Hide resolved
...a/org/apache/ignite/internal/table/distributed/replication/PartitionReplicaListenerTest.java
Outdated
Show resolved
Hide resolved
finishTxCmdBldr.commitTimestampLong(commitTimestamp.longValue()); | ||
} | ||
return catalogVersionFor(currentTimestamp) | ||
.thenApply(catalogVersion -> { |
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.
Good comment from Vanya, of the same opinion.
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
Show resolved
Hide resolved
...tegrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaSyncAndReplicationTest.java
Outdated
Show resolved
Hide resolved
modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
Show resolved
Hide resolved
finishTxCmdBldr.commitTimestampLong(commitTimestamp.longValue()); | ||
} | ||
return catalogVersionFor(currentTimestamp) | ||
.thenApply(catalogVersion -> { |
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.
wait
.../org/apache/ignite/internal/table/distributed/schema/CheckCatalogVersionOnAppendEntries.java
Outdated
Show resolved
Hide resolved
.../org/apache/ignite/internal/table/distributed/schema/CheckCatalogVersionOnAppendEntries.java
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/impl/ActionRequestProcessor.java
Outdated
Show resolved
Hide resolved
modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/impl/IgniteRpcServer.java
Outdated
Show resolved
Hide resolved
catalogManager = new CatalogManagerImpl( | ||
new UpdateLogImpl(metaStorageMgr), | ||
clockWaiter, | ||
() -> schemaSyncConfig.delayDuration().value() | ||
delayDurationMsSupplier |
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.
Why not pass a constant instead of closure ?
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.
Because at the moment the constructor is called the node is not started yet, and the configuration becomes available only after we start the node
|
||
if (requiredCatalogVersion != NO_VERSION_REQUIREMENT && !isMetadataAvailableFor(requiredCatalogVersion)) { | ||
LOG.warn("Metadata not yet available, group {}, required level {}.", request.groupId(), requiredCatalogVersion); | ||
return RaftRpcFactory.DEFAULT // |
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.
We need to keep an eye on a number of rejected messages, some new stat field would be great. Can be done as a separate ticket.
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.
I filed a ticket https://issues.apache.org/jira/browse/IGNITE-20298 and added a TODO mentioning this ticket
@@ -42,6 +43,9 @@ public class RaftGroupOptions { | |||
/** Configuration of own striped disruptor for FSMCaller service of raft node, {@code null} means use shared disruptor. */ | |||
private @Nullable RaftNodeDisruptorConfiguration ownFsmCallerExecutorDisruptorConfig; | |||
|
|||
/** Marshaller to marshall/unmarshall commands. */ | |||
private @Nullable Marshaller commandsMarshaller; |
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.
Why do we need to override marshaller ? For test purposes ?
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.
For partitions, we need to quickly extract requiredCatalogVersion from command's serialized representation without parsing the whole command. To do so, I tweaked the marshaller used for partitions, but it adds one byte to each command that does not have that requiredCatalogVersion. If we use same marshaller for other (non-partition) groups, we unnecessarily increase their (serialized) sizes as well. Hence the necessity to have ability to supply a different marshaller.
https://issues.apache.org/jira/browse/IGNITE-19227
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes