Skip to content

[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
Cpaulyz:IOTDB-5719
Apr 19, 2023
Merged

[To rel/1.1][IOTDB-5719] Move DataNode's checking of SchemaQuota above the consensus layer#9626
MarcosZyk merged 13 commits intoapache:rel/1.1from
Cpaulyz:IOTDB-5719

Conversation

@Cpaulyz
Copy link
Contributor

@Cpaulyz Cpaulyz commented Apr 17, 2023

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:

  1. Creation of a time series
  2. Creation of aligned time series
  3. Activating metadata templates

Comment on lines +798 to +799
if (!mtree.checkDeviceNodeExists(devicePath)) {
schemaQuotaManager.checkDeviceLevel();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any statistic variable representing device num that can be used in this judgement?

Copy link
Contributor

@MarcosZyk MarcosZyk left a comment

Choose a reason for hiding this comment

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

Please remember add device check when executing activateTemplate, BatchActivateTemplate and InternalBatchActivateTemplate.

@Cpaulyz
Copy link
Contributor Author

Cpaulyz commented Apr 18, 2023

Please remember add device check when executing activateTemplate, BatchActivateTemplate and InternalBatchActivateTemplate.

done.

@Cpaulyz Cpaulyz requested a review from MarcosZyk April 18, 2023 03:59
@MarcosZyk MarcosZyk merged commit 197890b into apache:rel/1.1 Apr 19, 2023
@Cpaulyz Cpaulyz deleted the IOTDB-5719 branch April 19, 2023 08:18
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