Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dd5dd97
[Information Schema] Add SPI extension points for information schema
shuwenwei Sep 17, 2026
a9567a0
[ConfigNode] Inject additional persistence and snapshot processors vi…
shuwenwei Sep 17, 2026
a358887
[RPC] Reserve LBAC status codes
shuwenwei Sep 17, 2026
29c06fb
[LBAC] Add LBAC access control abstraction with allow-all default imp…
shuwenwei Sep 17, 2026
b59462d
[Auth] Persist user/role profiles with a versioned extra segment region
shuwenwei Sep 17, 2026
2ee6391
[LBAC] Clarify AllowAllLBACAccessControl javadoc
shuwenwei Sep 17, 2026
0789228
[Auth] Remove unused Role/User serialize and deserialize
shuwenwei Sep 17, 2026
2d75ef3
[Query] Log LBAC access errors at info level
shuwenwei Sep 17, 2026
3f075d1
[ConfigNode] Reserve snapshot file types and column-properties proced…
shuwenwei Sep 17, 2026
0bcc213
set table column properties
shuwenwei Sep 18, 2026
a2a2749
[Query] Add the SetColumnProperties execution flow
shuwenwei Sep 21, 2026
b3f50e5
[Query] Resolve insert target tables per row only for pipe batches
shuwenwei Sep 21, 2026
b34a647
[LBAC] Lazily allocate RequiredLabels sets
shuwenwei Sep 21, 2026
536315a
[Query] Propagate table and column properties into relational schemas
shuwenwei Sep 21, 2026
ec5b274
[Query] Add long-list memory estimation helper
shuwenwei Sep 21, 2026
4cd6f70
Merge branch 'iotdb_master' into sync-generic-changes
shuwenwei Sep 21, 2026
4739e35
[Test] Mark multi-table insert rows as pipe batch in SchemaValidatorTest
shuwenwei Sep 21, 2026
a67e632
Merge branch 'iotdb_master' into sync-generic-changes
shuwenwei Oct 8, 2026
65ec512
[Query] Mark uniform insert targets at the write path
shuwenwei Oct 8, 2026
a8c7bc9
[ConfigNode] Reject user/role profiles written by a newer version
shuwenwei Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,28 @@ public enum TSStatusCode {
EXTERNAL_SERVICE_INSTANCE_CREATE_ERROR(2303),
CANNOT_DROP_BUILTIN_EXTERNAL_SERVICE(2304),
CANNOT_DROP_RUNNING_EXTERNAL_SERVICE(2305),

// LBAC
LBAC_ACCESS_DENIED(2400),
COMPONENT_NOT_EXISTS(2401),
COMPONENT_ALREADY_EXISTS(2402),
POLICY_NOT_EXISTS(2403),
POLICY_ALREADY_EXISTS(2404),
LABEL_NOT_EXISTS(2405),
LABEL_ALREADY_EXISTS(2406),
ELEMENT_NOT_EXISTS(2407),
ELEMENT_ALREADY_EXISTS(2408),
INVALID_COMPONENT_TYPE(2409),
INVALID_ELEMENT_CLAUSE(2410),
INVALID_COMMENT_TARGET(2411),
COMPONENT_IS_REFERENCED(2412),
POLICY_IS_REFERENCED(2413),
LABEL_IS_REFERENCED(2414),
POLICY_NOT_SET(2415),
POLICY_ALREADY_SET(2416),
POLICY_CONFLICT(2417),
LABEL_NOT_SET(2418),
INVALID_LABEL_VALUE(2419),
;

private final int statusCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ private ManagerMessages() {}
public static final String LOG_GOT_IOEXCEPTION_DESERIALIZE_USE_ROLE_FILE_TYPE_ARG_1B548759 = "Got IOException when deserialize use&role file, type:{}";
public static final String LOG_GOT_IOEXCEPTION_DESERIALIZE_ROLELIST_1354F29E = "Got IOException when deserialize roleList";
public static final String LOG_GOT_EXCEPTION_DESERIALIZING_TTL_FILE_F806EB40 = "Got exception when deserializing ttl file";
public static final String LOG_UNSUPPORTED_USER_ROLE_PROFILE_VERSION_ARG_THIS_NODE_SUPPORTS_UP_TO_ARG_2ABBF4FA = "Unsupported user/role profile version %d, this node supports up to %d";
public static final String LOG_UNRECOGNIZED_NODE_TYPE_CANNOT_DESERIALIZE_MTREE_GIVEN_BUFFER_5CF3121B = "Unrecognized node type. Cannot deserialize MTree from given buffer";
public static final String LOG_GOT_IOEXCEPTION_CONSTRUCT_DATABASE_TREE_49436621 = "Got IOException when construct database Tree";
public static final String LOG_GOT_IOEXCEPTION_DESERIALIZE_TEMPLATE_INFO_49EE617E = "Got IOException when deserialize template info";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ private ManagerMessages() {}
public static final String LOG_SCHEMA_TEMPLATE_NEED_TWO_FILES_1E57542A = "schema_template 需要两个文件";
public static final String LOG_GOT_IOEXCEPTION_DESERIALIZE_USE_ROLE_FILE_TYPE_ARG_1B548759 = "反序列化 use&role 文件时发生 IOException,类型:{}";
public static final String LOG_GOT_IOEXCEPTION_DESERIALIZE_ROLELIST_1354F29E = "反序列化 roleList 时发生 IOException";
public static final String LOG_UNSUPPORTED_USER_ROLE_PROFILE_VERSION_ARG_THIS_NODE_SUPPORTS_UP_TO_ARG_2ABBF4FA = "不支持的用户/角色 profile 版本 %d,当前节点最高支持到 %d";
public static final String LOG_GOT_EXCEPTION_DESERIALIZING_TTL_FILE_F806EB40 = "反序列化 ttl 文件时发生异常";
public static final String LOG_UNRECOGNIZED_NODE_TYPE_CANNOT_DESERIALIZE_MTREE_GIVEN_BUFFER_5CF3121B = "无法识别节点类型,无法从给定缓冲区反序列化 MTree";
public static final String LOG_GOT_IOEXCEPTION_CONSTRUCT_DATABASE_TREE_49436621 = "构建数据库树时发生 IOException";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
import org.apache.iotdb.confignode.consensus.request.write.table.RollbackCreateTablePlan;
import org.apache.iotdb.confignode.consensus.request.write.table.RollbackPreDeleteTablePlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableColumnCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableColumnPropertiesPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTablePropertiesPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.view.AddTableViewColumnPlan;
Expand Down Expand Up @@ -430,6 +431,9 @@ public static ConfigPhysicalPlan create(final ByteBuffer buffer) throws IOExcept
case SetTableProperties:
plan = new SetTablePropertiesPlan(configPhysicalPlanType);
break;
case SetTableColumnProperties:
plan = new SetTableColumnPropertiesPlan(configPhysicalPlanType);
break;
case SetViewProperties:
plan = new SetViewPropertiesPlan();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
AlterColumnDataType((short) 878),
PreAlterColumnDataType((short) 879),
RollbackPreDeleteTable((short) 880),
SetTableColumnProperties((short) 881),

Check failure on line 236 in iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanType.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.

See more on https://sonarcloud.io/project/issues?id=apache_iotdb&issues=AaEZn0bsdwEzUswl_LzO&open=AaEZn0bsdwEzUswl_LzO&pullRequest=18683

/** Deprecated types for sync, restored them for upgrade. */
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.apache.iotdb.confignode.consensus.request.write.table.RenameTableColumnPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.RenameTablePlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableColumnCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableColumnPropertiesPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTablePropertiesPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.view.AddTableViewColumnPlan;
Expand Down Expand Up @@ -174,6 +175,8 @@ public R process(final ConfigPhysicalPlan plan, final C context) {
return visitAddTableViewColumn((AddTableViewColumnPlan) plan, context);
case SetTableProperties:
return visitSetTableProperties((SetTablePropertiesPlan) plan, context);
case SetTableColumnProperties:
return visitSetTableColumnProperties((SetTableColumnPropertiesPlan) plan, context);
case SetViewProperties:
return visitSetViewProperties((SetViewPropertiesPlan) plan, context);
case RenameTableColumn:
Expand Down Expand Up @@ -462,6 +465,11 @@ public R visitSetTableProperties(
return visitPlan(setTablePropertiesPlan, context);
}

public R visitSetTableColumnProperties(
final SetTableColumnPropertiesPlan setTableColumnPropertiesPlan, final C context) {
return visitPlan(setTableColumnPropertiesPlan, context);
}

// Use set table properties by default
public R visitSetViewProperties(
final SetViewPropertiesPlan setViewPropertiesPlan, final C context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iotdb.confignode.consensus.request.write.table;

import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanType;

import org.apache.tsfile.utils.ReadWriteIOUtils;

import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;

public class SetTableColumnPropertiesPlan extends AbstractTablePlan {

Check warning on line 31 in iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/table/SetTableColumnPropertiesPlan.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Override the "equals" method in this class.

See more on https://sonarcloud.io/project/issues?id=apache_iotdb&issues=AaEZn0WsdwEzUswl_LzN&open=AaEZn0WsdwEzUswl_LzN&pullRequest=18683

private String columnName;
private Map<String, String> properties;
private boolean isRollback;

public SetTableColumnPropertiesPlan(final ConfigPhysicalPlanType type) {
super(type);
}

public SetTableColumnPropertiesPlan(
final String database,
final String tableName,
final String columnName,
final Map<String, String> properties,
final boolean isRollback) {
super(ConfigPhysicalPlanType.SetTableColumnProperties, database, tableName);
this.columnName = columnName;
this.properties = properties;
this.isRollback = isRollback;
}

public String getColumnName() {
return columnName;
}

public Map<String, String> getProperties() {
return properties;
}

public boolean isRollback() {
return isRollback;
}

@Override
protected void serializeImpl(final DataOutputStream stream) throws IOException {
super.serializeImpl(stream);
ReadWriteIOUtils.write(columnName, stream);
ReadWriteIOUtils.write(properties, stream);
ReadWriteIOUtils.write(isRollback, stream);
}

@Override
protected void deserializeImpl(final ByteBuffer buffer) throws IOException {
super.deserializeImpl(buffer);
this.columnName = ReadWriteIOUtils.readString(buffer);
this.properties = ReadWriteIOUtils.readMap(buffer);
this.isRollback = ReadWriteIOUtils.readBool(buffer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.apache.iotdb.commons.schema.tree.AlterTimeSeriesOperationType;
import org.apache.iotdb.commons.schema.ttl.TTLCache;
import org.apache.iotdb.commons.service.metric.MetricService;
import org.apache.iotdb.commons.snapshot.SnapshotProcessor;
import org.apache.iotdb.commons.subscription.meta.consumer.CommitProgressKeeper;
import org.apache.iotdb.commons.subscription.meta.consumer.SubscriptionProgressSnapshot;
import org.apache.iotdb.commons.utils.AuthUtils;
Expand Down Expand Up @@ -378,58 +379,44 @@

public ConfigManager() throws IOException {
// Build the persistence module
ClusterInfo clusterInfo = new ClusterInfo();
NodeInfo nodeInfo = new NodeInfo();
ClusterSchemaInfo clusterSchemaInfo = new ClusterSchemaInfo();
PartitionInfo partitionInfo = new PartitionInfo();
AuthorInfo authorInfo = createAuthorInfo();
ProcedureInfo procedureInfo = new ProcedureInfo(this);
UDFInfo udfInfo = new UDFInfo();
TriggerInfo triggerInfo = new TriggerInfo();
CQInfo cqInfo = new CQInfo();
ExternalServiceInfo externalServiceInfo = new ExternalServiceInfo();
this.permissionManager = createPermissionManager(authorInfo);
PipeInfo pipeInfo = new PipeInfo(userName -> this.permissionManager.login4Pipe(userName, null));
QuotaInfo quotaInfo = new QuotaInfo();
TTLInfo ttlInfo = new TTLInfo();
SubscriptionInfo subscriptionInfo = new SubscriptionInfo();

ConfigManagerContext context = createConfigManagerContext();
context.clusterInfo = new ClusterInfo();
context.nodeInfo = new NodeInfo();
context.clusterSchemaInfo = new ClusterSchemaInfo();
context.partitionInfo = new PartitionInfo();
context.authorInfo = createAuthorInfo();
context.procedureInfo = new ProcedureInfo(this);
context.udfInfo = new UDFInfo();
context.triggerInfo = new TriggerInfo();
context.cqInfo = new CQInfo();
context.externalServiceInfo = new ExternalServiceInfo();
this.permissionManager = createPermissionManager(context.authorInfo);
context.pipeInfo = new PipeInfo(userName -> this.permissionManager.login4Pipe(userName, null));
context.quotaInfo = new QuotaInfo();
context.ttlInfo = new TTLInfo();
context.subscriptionInfo = new SubscriptionInfo();
initAdditionalInfos(context);
// Build state machine and executor
ConfigPlanExecutor executor =
new ConfigPlanExecutor(
clusterInfo,
nodeInfo,
clusterSchemaInfo,
partitionInfo,
authorInfo,
procedureInfo,
udfInfo,
triggerInfo,
cqInfo,
externalServiceInfo,
pipeInfo,
subscriptionInfo,
quotaInfo,
ttlInfo);
ConfigPlanExecutor executor = createConfigPlanExecutor(context);
this.stateMachine = new ConfigRegionStateMachine(this, executor);

// Build the manager module
this.clusterManager = new ClusterManager(this, clusterInfo);
setNodeManager(nodeInfo);
this.clusterManager = new ClusterManager(this, context.clusterInfo);
setNodeManager(context.nodeInfo);
this.clusterSchemaManager =
new ClusterSchemaManager(
this,
clusterSchemaInfo,
context.clusterSchemaInfo,
new ClusterSchemaQuotaStatistics(
COMMON_CONF.getSeriesLimitThreshold(), COMMON_CONF.getDeviceLimitThreshold()));
this.partitionManager = new PartitionManager(this, partitionInfo);
this.procedureManager = createProcedureManager(procedureInfo);
this.partitionManager = new PartitionManager(this, context.partitionInfo);
this.procedureManager = createProcedureManager(context.procedureInfo);
this.externalServiceManager = new ExternalServiceManager(this);
this.udfManager = new UDFManager(this, udfInfo);
this.triggerManager = new TriggerManager(this, triggerInfo);
this.udfManager = new UDFManager(this, context.udfInfo);
this.triggerManager = new TriggerManager(this, context.triggerInfo);
this.cqManager = new CQManager(this);
this.pipeManager = new PipeManager(this, pipeInfo);
this.subscriptionManager = new SubscriptionManager(this, subscriptionInfo);
this.pipeManager = new PipeManager(this, context.pipeInfo);
this.subscriptionManager = new SubscriptionManager(this, context.subscriptionInfo);
this.auditLogger = new CNAuditLogger(this);

// 1. keep PipeManager initialization before LoadManager initialization, because
Expand All @@ -439,8 +426,8 @@
setLoadManager();

this.retryFailedTasksThread = new RetryFailedTasksThread(this);
this.clusterQuotaManager = new ClusterQuotaManager(this, quotaInfo);
this.ttlManager = new TTLManager(this, ttlInfo);
this.clusterQuotaManager = new ClusterQuotaManager(this, context.quotaInfo);
this.ttlManager = new TTLManager(this, context.ttlInfo);
}

public void initConsensusManager() throws IOException {
Expand All @@ -460,6 +447,16 @@
return new AuthorInfo();
}

protected ConfigManagerContext createConfigManagerContext() {
return new ConfigManagerContext();
}

protected void initAdditionalInfos(final ConfigManagerContext context) {}

Check warning on line 454 in iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'}' at column 75 should be alone on a line.

See more on https://sonarcloud.io/project/issues?id=apache_iotdb&issues=AaEZn0lXdwEzUswl_LzQ&open=AaEZn0lXdwEzUswl_LzQ&pullRequest=18683

Check failure on line 454 in iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.

See more on https://sonarcloud.io/project/issues?id=apache_iotdb&issues=AaEZn0lXdwEzUswl_LzP&open=AaEZn0lXdwEzUswl_LzP&pullRequest=18683

protected ConfigPlanExecutor createConfigPlanExecutor(final ConfigManagerContext context) {
return new ConfigPlanExecutor(context);
}

protected void setNodeManager(NodeInfo nodeInfo) {
this.nodeManager = new NodeManager(this, nodeInfo);
}
Expand Down Expand Up @@ -3345,6 +3342,8 @@
return procedureManager.alterTableAddColumn(req);
case SET_PROPERTIES:
return procedureManager.alterTableSetProperties(req);
case SET_COLUMN_PROPERTIES:
return procedureManager.alterTableSetColumnProperties(req);
case RENAME_COLUMN:
return procedureManager.alterTableRenameColumn(req);
case DROP_COLUMN:
Expand Down Expand Up @@ -3496,4 +3495,26 @@
public void setPermissionManager(final PermissionManager permissionManager) {
this.permissionManager = permissionManager;
}

public static class ConfigManagerContext {

public ClusterInfo clusterInfo;
public NodeInfo nodeInfo;
public ClusterSchemaInfo clusterSchemaInfo;
public PartitionInfo partitionInfo;
public AuthorInfo authorInfo;
public ProcedureInfo procedureInfo;
public UDFInfo udfInfo;
public TriggerInfo triggerInfo;
public CQInfo cqInfo;
public ExternalServiceInfo externalServiceInfo;
public PipeInfo pipeInfo;
public SubscriptionInfo subscriptionInfo;
public QuotaInfo quotaInfo;
public TTLInfo ttlInfo;

public List<SnapshotProcessor> getAdditionalInfoList() {
return Collections.emptyList();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
import org.apache.iotdb.confignode.procedure.impl.schema.table.DropTableProcedure;
import org.apache.iotdb.confignode.procedure.impl.schema.table.RenameTableColumnProcedure;
import org.apache.iotdb.confignode.procedure.impl.schema.table.RenameTableProcedure;
import org.apache.iotdb.confignode.procedure.impl.schema.table.SetTableColumnPropertiesProcedure;
import org.apache.iotdb.confignode.procedure.impl.schema.table.SetTablePropertiesProcedure;
import org.apache.iotdb.confignode.procedure.impl.schema.table.view.AddViewColumnProcedure;
import org.apache.iotdb.confignode.procedure.impl.schema.table.view.CreateTableViewProcedure;
Expand Down Expand Up @@ -2286,6 +2287,25 @@ public TSStatus alterTableSetProperties(final TAlterOrDropTableReq req) {
false));
}

public TSStatus alterTableSetColumnProperties(final TAlterOrDropTableReq req) {
final String columnName = ReadWriteIOUtils.readString(req.updateInfo);
final SetTableColumnPropertiesProcedure procedure =
new SetTableColumnPropertiesProcedure(
req.database,
req.tableName,
columnName,
req.queryId,
ReadWriteIOUtils.readMap(req.updateInfo),
false);
return executeWithoutDuplicate(
req.database,
null,
req.tableName,
req.queryId,
ProcedureType.SET_TABLE_COLUMN_PROPERTIES_PROCEDURE,
procedure);
}

public TSStatus alterTableRenameColumn(final TAlterOrDropTableReq req) {
final boolean isView = req.isSetIsView() && req.isIsView();
return executeWithoutDuplicate(
Expand Down Expand Up @@ -2538,6 +2558,7 @@ public Pair<Long, Boolean> checkDuplicateTableTask(
case ADD_VIEW_COLUMN_PROCEDURE:
case SET_TABLE_PROPERTIES_PROCEDURE:
case SET_VIEW_PROPERTIES_PROCEDURE:
case SET_TABLE_COLUMN_PROPERTIES_PROCEDURE:
case RENAME_TABLE_COLUMN_PROCEDURE:
case RENAME_VIEW_COLUMN_PROCEDURE:
case DROP_TABLE_COLUMN_PROCEDURE:
Expand Down
Loading
Loading