Repository navigation
Isolate writes to the internal system database root.__system - #19017
Merged
Merged
Conversation
alpass163
force-pushed
the
cyb/seal_system_db
branch
from
October 26, 2026 08:25
131aaa9 to
959d2f6
Compare
Caideyipi
reviewed
Oct 26, 2026
Caideyipi
reviewed
Oct 26, 2026
JackieTien97
approved these changes
Oct 26, 2026
VGalaxies
pushed a commit
to VGalaxies/iotdb
that referenced
this pull request
Oct 29, 2026
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
Motivation
root.__systemis maintained by the database itself. In the open-sourceversion, external clients could write it, delete it, or create it through
SQL. The name was also matched case-insensitively, so
root.__Systemwastreated as the same internal database even though tree-model paths are
case-sensitive.
This PR makes the exact lower-case name reserved and restricts its writes to
dedicated internal writers. Names that differ only in case are ordinary
databases and stay fully usable.
Changes
InternalDatabaseUtilstoidentify
root.__systemand the audit databases. Matching iscase-sensitive and includes descendants (
root.__system.x).SessionInfo.internal,IAuditEntity.isInternal()andTreeAccessCheckContext.internal. Onlythe internal metric reporter (
IoTDBInternalLocalReporter) and theinternal insert RPC (
DataNodeInternalRPCServiceImpl.insertRecord) setit.
AutoCreateSchemaExecutornow passes the query context instead of abare
UserEntity, so the flag survives automatic schema creation.TreeAccessCheckVisitor.checkSystemDatabaseWrite.It is applied to inserts, timeseries DDL, template statements, TTL,
logical view targets and sources, and centrally in
checkTimeSeriesPermission.AnalyzeUtilsand the delete analysis re-check the realdevice paths after a writable view is rewritten, so a view created before
this restriction cannot write
root.__system.AccessControlImpl.checkFullPathWriteDataPermissionappliesthe same guard.
visitSetDatabaserejects creatingroot.__system(andits descendants) through SQL;
visitAlterDatabaseandvisitDeleteDatabasealready rejected altering and deleting it.Audithelpers and the directequalsIgnoreCasecomparisons inAccessControlImpl,ITableAuthCheckerImpl,ClusterConfigTaskExecutor,ConfigManager,PartitionInfoandSubscriptionInfonow useequals.root.statisticsinstead ofroot.__system.statistics, andiotdb-system.properties.templatestates that the IOTDB session metricreporter is not supported because its writes are rejected.