Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -2635,7 +2635,7 @@ public class Config extends ConfigBase {
+ "DELETE statements, but partial column updates after a DELETE may result in erroneous data. "
+ "If disabled, it will reduce the performance of DELETE statements to ensure accuracy."
})
public static boolean enable_mow_delete_on_predicate = false;
public static boolean enable_mow_light_delete = false;

@ConfField(description = {
"是否开启 Proxy Protocol 支持",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,21 @@ private void createRollupReplicaForPartition(OlapTable tbl) throws Exception {
((CloudInternalCatalog) Env.getCurrentInternalCatalog())
.createTabletMetaBuilder(tableId, rollupIndexId,
partitionId, rollupTablet, tabletType, rollupSchemaHash,
rollupKeysType, rollupShortKeyColumnCount, tbl.getCopiedBfColumns(),
tbl.getBfFpp(), null, rollupSchema,
tbl.getDataSortInfo(), tbl.getCompressionType(), tbl.getStoragePolicy(),
tbl.isInMemory(), true,
tbl.getName(), tbl.getTTLSeconds(),
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.storeRowColumn(),
tbl.getBaseSchemaVersion(), tbl.getCompactionPolicy(),
tbl.getTimeSeriesCompactionGoalSizeMbytes(),
tbl.getTimeSeriesCompactionFileCountThreshold(),
tbl.getTimeSeriesCompactionTimeThresholdSeconds(),
tbl.getTimeSeriesCompactionEmptyRowsetsThreshold(),
tbl.getTimeSeriesCompactionLevelThreshold(),
tbl.disableAutoCompaction(),
tbl.getRowStoreColumnsUniqueIds(rowStoreColumns));
rollupKeysType, rollupShortKeyColumnCount, tbl.getCopiedBfColumns(),
tbl.getBfFpp(), null, rollupSchema,
tbl.getDataSortInfo(), tbl.getCompressionType(), tbl.getStoragePolicy(),
tbl.isInMemory(), true,
tbl.getName(), tbl.getTTLSeconds(),
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.storeRowColumn(),
tbl.getBaseSchemaVersion(), tbl.getCompactionPolicy(),
tbl.getTimeSeriesCompactionGoalSizeMbytes(),
tbl.getTimeSeriesCompactionFileCountThreshold(),
tbl.getTimeSeriesCompactionTimeThresholdSeconds(),
tbl.getTimeSeriesCompactionEmptyRowsetsThreshold(),
tbl.getTimeSeriesCompactionLevelThreshold(),
tbl.disableAutoCompaction(),
tbl.getRowStoreColumnsUniqueIds(rowStoreColumns),
tbl.getEnableMowLightDelete());
requestBuilder.addTabletMetas(builder);
} // end for rollupTablets
((CloudInternalCatalog) Env.getCurrentInternalCatalog())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,24 @@ private void createShadowIndexReplicaForPartition(OlapTable tbl) throws Exceptio
for (Tablet shadowTablet : shadowIdx.getTablets()) {
OlapFile.TabletMetaCloudPB.Builder builder =
((CloudInternalCatalog) Env.getCurrentInternalCatalog())
.createTabletMetaBuilder(tableId, shadowIdxId,
partitionId, shadowTablet, tbl.getPartitionInfo().getTabletType(partitionId),
shadowSchemaHash, originKeysType, shadowShortKeyColumnCount, bfColumns,
bfFpp, tabletIndexes, shadowSchema, tbl.getDataSortInfo(), tbl.getCompressionType(),
tbl.getStoragePolicy(), tbl.isInMemory(), true,
tbl.getName(), tbl.getTTLSeconds(),
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.storeRowColumn(),
shadowSchemaVersion, tbl.getCompactionPolicy(),
tbl.getTimeSeriesCompactionGoalSizeMbytes(),
tbl.getTimeSeriesCompactionFileCountThreshold(),
tbl.getTimeSeriesCompactionTimeThresholdSeconds(),
tbl.getTimeSeriesCompactionEmptyRowsetsThreshold(),
tbl.getTimeSeriesCompactionLevelThreshold(),
tbl.disableAutoCompaction(),
tbl.getRowStoreColumnsUniqueIds(rowStoreColumns));
.createTabletMetaBuilder(tableId, shadowIdxId,
partitionId, shadowTablet,
tbl.getPartitionInfo().getTabletType(partitionId),
shadowSchemaHash, originKeysType, shadowShortKeyColumnCount, bfColumns,
bfFpp, tabletIndexes, shadowSchema, tbl.getDataSortInfo(),
tbl.getCompressionType(),
tbl.getStoragePolicy(), tbl.isInMemory(), true,
tbl.getName(), tbl.getTTLSeconds(),
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.storeRowColumn(),
shadowSchemaVersion, tbl.getCompactionPolicy(),
tbl.getTimeSeriesCompactionGoalSizeMbytes(),
tbl.getTimeSeriesCompactionFileCountThreshold(),
tbl.getTimeSeriesCompactionTimeThresholdSeconds(),
tbl.getTimeSeriesCompactionEmptyRowsetsThreshold(),
tbl.getTimeSeriesCompactionLevelThreshold(),
tbl.disableAutoCompaction(),
tbl.getRowStoreColumnsUniqueIds(rowStoreColumns),
tbl.getEnableMowLightDelete());
requestBuilder.addTabletMetas(builder);
} // end for rollupTablets
((CloudInternalCatalog) Env.getCurrentInternalCatalog())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,7 @@ public void updateTableProperties(Database db, String tableName, Map<String, Str
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_TIME_SERIES_COMPACTION_TIME_THRESHOLD_SECONDS)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_GROUP_COMMIT_INTERVAL_MS)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_GROUP_COMMIT_DATA_BYTES)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_SINGLE_REPLICA_COMPACTION)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD)
Expand Down Expand Up @@ -2339,7 +2339,7 @@ public void updateTableProperties(Database db, String tableName, Map<String, Str

if (isInMemory < 0 && storagePolicyId < 0 && compactionPolicy == null && timeSeriesCompactionConfig.isEmpty()
&& !properties.containsKey(PropertyAnalyzer.PROPERTIES_IS_BEING_SYNCED)
&& !properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE)
&& !properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE)
&& !properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_SINGLE_REPLICA_COMPACTION)
&& !properties.containsKey(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION)
&& !properties.containsKey(PropertyAnalyzer.PROPERTIES_GROUP_COMMIT_INTERVAL_MS)
Expand All @@ -2360,11 +2360,11 @@ public void updateTableProperties(Database db, String tableName, Map<String, Str
"enable_single_replica_compaction property is not supported for merge-on-write table");
}

String enableMowDeleteOnDeletePredicate = properties.get(
PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE);
if (!enableUniqueKeyMergeOnWrite && Boolean.getBoolean(enableMowDeleteOnDeletePredicate)) {
String enableMowLightDelete = properties.get(
PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE);
if (enableMowLightDelete != null && !enableUniqueKeyMergeOnWrite) {
throw new UserException(
"enable_mow_delete_on_delete_predicate property is not supported for unique merge-on-read table");
"enable_mow_light_delete property is only supported for unique merge-on-write table");
}

String disableAutoCompactionBoolean = properties.get(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void analyze(Analyzer analyzer) throws UserException {

// analyze predicate
if ((fromClause == null && !((OlapTable) targetTable).getEnableUniqueKeyMergeOnWrite())
|| (fromClause == null && ((OlapTable) targetTable).getEnableDeleteOnDeletePredicate())) {
|| (fromClause == null && ((OlapTable) targetTable).getEnableMowLightDelete())) {
if (wherePredicate == null) {
throw new AnalysisException("Where clause is not set");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,28 +270,25 @@ public void analyze(Analyzer analyzer) throws AnalysisException {
}
this.needTableStable = false;
this.opType = AlterOpType.MODIFY_TABLE_PROPERTY_SYNC;
} else if (properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE)) {
if (!properties.get(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE)
} else if (properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE)) {
if (!properties.get(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE)
.equalsIgnoreCase("true")
&& !properties.get(PropertyAnalyzer
.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE).equalsIgnoreCase("false")) {
.PROPERTIES_ENABLE_MOW_LIGHT_DELETE).equalsIgnoreCase("false")) {
throw new AnalysisException(
"Property "
+ PropertyAnalyzer.PROPERTIES_ENABLE_SINGLE_REPLICA_COMPACTION
+ PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE
+ " should be set to true or false");
}
OlapTable table = null;
if (tableName != null) {
table = (OlapTable) (Env.getCurrentInternalCatalog().getDbOrAnalysisException(tableName.getDb())
.getTableOrAnalysisException(tableName.getTbl()));
}
String enableMowDeleteOnDeletePredicate = properties.get(
PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE);
if (!(table == null) && !table.getEnableUniqueKeyMergeOnWrite() && Boolean.getBoolean(
enableMowDeleteOnDeletePredicate)) {
if (table == null || !table.getEnableUniqueKeyMergeOnWrite()) {
throw new AnalysisException(
"enable_mow_delete_on_delete_predicate property is "
+ "not supported for unique merge-on-read table");
"enable_mow_light_delete property is "
+ "only supported for unique merge-on-write table");
}
this.needTableStable = false;
this.opType = AlterOpType.MODIFY_TABLE_PROPERTY_SYNC;
Expand Down
4 changes: 2 additions & 2 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -3596,9 +3596,9 @@ private static void addOlapTablePropertyInfo(OlapTable olapTable, StringBuilder

// enable delete on delete predicate
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS && olapTable.getEnableUniqueKeyMergeOnWrite()) {
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE)
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE)
.append("\" = \"");
sb.append(olapTable.getEnableDeleteOnDeletePredicate()).append("\"");
sb.append(olapTable.getEnableMowLightDelete()).append("\"");
}

// enable duplicate without keys by default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,12 @@ public Column getRowStoreCol() {
return null;
}

public void setEnableDeleteOnDeletePredicate(boolean enable) {
getOrCreatTableProperty().setEnableDeleteOnDeletePredicate(enable);
public void setEnableMowLightDelete(boolean enable) {
getOrCreatTableProperty().setEnableMowLightDelete(enable);
}

public boolean getEnableDeleteOnDeletePredicate() {
return getOrCreatTableProperty().getEnableDelteOnDeletePredicate();
public boolean getEnableMowLightDelete() {
return getOrCreatTableProperty().getEnableMowLightDelete();
}

public void setGroupCommitIntervalMs(int groupCommitInterValMs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,14 @@ public boolean getEnableUniqueKeyMergeOnWrite() {
PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE, "false"));
}

public void setEnableDeleteOnDeletePredicate(boolean enable) {
properties.put(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE, Boolean.toString(enable));
public void setEnableMowLightDelete(boolean enable) {
properties.put(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE, Boolean.toString(enable));
}

public boolean getEnableDelteOnDeletePredicate() {
public boolean getEnableMowLightDelete() {
return Boolean.parseBoolean(properties.getOrDefault(
PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE,
Boolean.toString(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_DELETE_ON_DELETE_PREDICATE_DEFAULT_VALUE)));
PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE,
Boolean.toString(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE_DEFAULT_VALUE)));
}

public void setSequenceMapCol(String colName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public void updateTableProperties(Database db, String tableName, Map<String, Str
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_TIME_SERIES_COMPACTION_TIME_THRESHOLD_SECONDS)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_TIME_SERIES_COMPACTION_EMPTY_ROWSETS_THRESHOLD)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_TIME_SERIES_COMPACTION_LEVEL_THRESHOLD)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION));
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE));

if (properties.size() != 1) {
throw new UserException("Can only set one table property at a time");
Expand Down Expand Up @@ -292,6 +293,29 @@ public void updateTableProperties(Database db, String tableName, Map<String, Str
}
param.disableAutoCompaction = disableAutoCompaction;
param.type = UpdatePartitionMetaParam.TabletMetaType.DISABLE_AUTO_COMPACTION;
} else if (properties.containsKey(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE)) {
boolean enableMowLightDelete = Boolean.parseBoolean(properties.get(PropertyAnalyzer
.PROPERTIES_ENABLE_MOW_LIGHT_DELETE));
olapTable.readLock();
try {
if (enableMowLightDelete
== olapTable.getEnableMowLightDelete()) {
LOG.info("enableMowLightDelete:{} is equal with"
+ " olapTable.getEnableMowLightDelete():{}",
enableMowLightDelete,
olapTable.getEnableMowLightDelete());
return;
}
if (!olapTable.getEnableUniqueKeyMergeOnWrite()) {
throw new UserException("enable_mow_light_delete property is "
+ "not supported for unique merge-on-read table");
}
partitions.addAll(olapTable.getPartitions());
} finally {
olapTable.readUnlock();
}
param.enableMowLightDelete = enableMowLightDelete;
param.type = UpdatePartitionMetaParam.TabletMetaType.ENABLE_MOW_LIGHT_DELETE;
} else {
LOG.warn("invalid properties:{}", properties);
throw new UserException("invalid properties");
Expand Down Expand Up @@ -323,6 +347,7 @@ public enum TabletMetaType {
TIME_SERIES_COMPACTION_EMPTY_ROWSETS_THRESHOLD,
TIME_SERIES_COMPACTION_LEVEL_THRESHOLD,
DISABLE_AUTO_COMPACTION,
ENABLE_MOW_LIGHT_DELETE,
}

TabletMetaType type;
Expand All @@ -338,6 +363,7 @@ public enum TabletMetaType {
long timeSeriesCompactionEmptyRowsetsThreshold = 0;
long timeSeriesCompactionLevelThreshold = 0;
boolean disableAutoCompaction = false;
boolean enableMowLightDelete = false;
}

public void updateCloudPartitionMeta(Database db,
Expand Down Expand Up @@ -412,6 +438,11 @@ public void updateCloudPartitionMeta(Database db,
infoBuilder.setDisableAutoCompaction(
param.disableAutoCompaction);
break;
case ENABLE_MOW_LIGHT_DELETE:
infoBuilder.setEnableMowLightDelete(
param.enableMowLightDelete
);
break;
default:
throw new UserException("Unknown TabletMetaType");
}
Expand Down
Loading