Uh oh!
There was an error while loading. Please reload this page.
Fixed multiple bugs related to schema - #17405
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## master #17405 +/- ##
============================================
- Coverage 39.81% 39.63% -0.18%
Complexity 312 312 ============================================
Files 5127 5134 +7 Lines 346390 346882 +492 Branches 44120 44188 +68 ============================================
- Hits 137903 137483 -420 - Misses 208487 209399 +912 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple schema-related correctness issues across TTL handling, schema plan serialization, schema traversal/iterator lifecycle, relational SQL AST deserialization, and table-device schema caching/invalidation.
Changes:
- Fixes incorrect counters/state resets (e.g., TTL cache count, schema-region statistics, logical view statistics).
- Corrects schema iteration and caching behaviors (unpinning skipped cached nodes, table-device schema fetching/grouping, cache invalidation targeting).
- Resolves various schema/SQL logic bugs (authorization validation, expression deserialization, auto-create filtering, procedure state progression, cached fullPath invalidation).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/ttl/TTLCache.java | Resets ttlCount on clear() to keep TTL rule counting consistent after cache resets/snapshot loads. |
| iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/filter/SchemaFilter.java | Makes filter extraction null-safe to avoid NPEs when traversing filter trees. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/SchemaRegionPlanType.java | Changes the plan-type byte for ALTER_ENCODING_COMPRESSOR to avoid a code collision. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/WrappedSegment.java | Cleans up segment construction signatures and fixes offset shifting logic in removeRecord. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/mnode/iterator/CachedTraverserIterator.java | Ensures skipped pinned nodes are unpinned when filtered out. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/mnode/iterator/MemoryTraverserIterator.java | Implements the new “release skipped node” hook for memory-backed traversal (no-op). |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/mnode/iterator/AbstractTraverserIterator.java | Adds a hook to release resources for skipped nodes during traversal. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java | Corrects logical view statistics updates to reflect the actual number of created views. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaRegionStatistics.java | Fixes clear() to actually reset view count and clears table-related statistics maps. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RelationalAuthorStatement.java | Fixes DROP_ROLE validation to check the role name, not the user name. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/Expression.java | Adds deserialization support for CURRENT_DATABASE and CURRENT_USER expressions. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java | Fixes table device schema fetcher bugs (method naming, per-row database grouping, cache request class relocation). |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java | Fixes column-level invalidation to target the correct (database, table) cache key and annotates table-model API. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/DeviceSchemaRequestCache.java | Moves cache class into the fetcher cache package to match new usage/imports. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/NormalSchemaFetcher.java | Fixes auto-create filtering logic to keep system OR audit series (instead of accidentally requiring both). |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ClusterSchemaFetcher.java | Same auto-create filtering fix for the clustered schema fetch path. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/table/DeleteDevicesProcedure.java | Fixes procedure state transitions during blacklist construction to avoid incorrect looping. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/mnode/impl/ConfigTableNode.java | Invalidates cached fullPath when renaming to keep path-derived behavior consistent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ACTIVATE_TEMPLATE_IN_CLUSTER((byte) 63), | ||
| PRE_DELETE_TIMESERIES_IN_CLUSTER((byte) 64), | ||
| ROLLBACK_PRE_DELETE_TIMESERIES((byte) 65), | ||
| ALTER_ENCODING_COMPRESSOR((byte) 66), | ||
| ALTER_ENCODING_COMPRESSOR((byte) 80), | ||
There was a problem hiding this comment.
Changing ALTER_ENCODING_COMPRESSOR’s planType from 66 to 80 fixes the duplicate-code issue with CREATE_LOGICAL_VIEW(66), but it doesn’t address clusters that may already have WAL/consensus logs containing the legacy value 66 for ALTER_ENCODING_COMPRESSOR: those entries will still be deserialized as CREATE_LOGICAL_VIEW and likely fail recovery. Consider adding backward-compatible deserialization for the legacy encoding (e.g., when code==66, peek the next serialized field to distinguish PlanNodeType.ALTER_ENCODING_COMPRESSOR vs logical-view payload) or otherwise provide an explicit migration/guard to prevent startup failures on upgrade.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Uh oh!
There was an error while loading. Please reload this page.




Description
As the title said.
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR