Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 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
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 @@ -367,6 +367,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 @@ -119,6 +119,7 @@
import org.apache.iotdb.confignode.consensus.request.write.table.RollbackPreAlterColumnDataTypePlan;
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 @@ -431,6 +432,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 @@ -234,6 +234,7 @@ public enum ConfigPhysicalPlanType {
PreAlterColumnDataType((short) 879),
RollbackPreDeleteTable((short) 880),
RollbackPreAlterColumnDataType((short) 881),
SetTableColumnProperties((short) 882),

/** 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 {

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 @@ -377,58 +378,44 @@ public class ConfigManager implements IManager {

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 @@ -438,8 +425,8 @@ public ConfigManager() throws IOException {
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 @@ -459,6 +446,16 @@ protected AuthorInfo createAuthorInfo() {
return new AuthorInfo();
}

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

protected void initAdditionalInfos(final ConfigManagerContext context) {}

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 @@ -3322,6 +3319,8 @@ public TSStatus alterOrDropTable(final TAlterOrDropTableReq req) {
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 @@ -3473,4 +3472,26 @@ public DataSet registerAINode(TAINodeRegisterReq req) {
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 @@ -113,6 +113,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 @@ -2418,6 +2419,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 @@ -2670,6 +2690,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