[To rel/1.1][IOTDB-5719] Move DataNode's checking of SchemaQuota above the consensus layer#9626
Merged
MarcosZyk merged 13 commits intoapache:rel/1.1from Apr 19, 2023
Merged
[To rel/1.1][IOTDB-5719] Move DataNode's checking of SchemaQuota above the consensus layer#9626MarcosZyk merged 13 commits intoapache:rel/1.1from
MarcosZyk merged 13 commits intoapache:rel/1.1from
Conversation
MarcosZyk
reviewed
Apr 17, 2023
Comment on lines
+798
to
+799
| if (!mtree.checkDeviceNodeExists(devicePath)) { | ||
| schemaQuotaManager.checkDeviceLevel(); |
Contributor
There was a problem hiding this comment.
Is there any statistic variable representing device num that can be used in this judgement?
server/src/main/java/org/apache/iotdb/db/metadata/rescon/DataNodeSchemaQuotaManager.java
Outdated
Show resolved
Hide resolved
MarcosZyk
reviewed
Apr 18, 2023
Contributor
MarcosZyk
left a comment
There was a problem hiding this comment.
Please remember add device check when executing activateTemplate, BatchActivateTemplate and InternalBatchActivateTemplate.
Contributor
Author
done. |
MarcosZyk
approved these changes
Apr 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The current DataNode check for SchemaQuota is performed in the SchemaRegion. RatisConsensus expects the state machine to respond identically to the same apply request in the same state. However, in the case of multiple replicas, due to instabilities such as synchronization delays, the SchemaQuotaInfo may be different for different replicas, which may result in different SchemaRegion replicas responding differently to the same apply request (some replicas execute successfully, some replicas throw a QuotaExceededException).
Therefore, this PR moves the DataNode's checking of SchemaQuota above the consensus layer. The checks are performed before the execution plan enters the consensus layer to avoid errors.
The check cases involved are: