Revert "[fix](tablet invert index) fix tablet invert index leaky caused by auto partition (#33714)"

This reverts commit 89441b0cb0e27e332e7a806838c0fdac47f1de26.
This commit is contained in:
yiguolei
2024-04-21 20:26:06 +08:00
parent c6fad11154
commit 18d191b293
2 changed files with 8 additions and 66 deletions

View File

@ -1416,9 +1416,7 @@ public class InternalCatalog implements CatalogIf<Database> {
if (olapTable.checkPartitionNameExist(partitionName)) {
if (singlePartitionDesc.isSetIfNotExists()) {
LOG.info("add partition[{}] which already exists", partitionName);
if (!DebugPointUtil.isEnable("InternalCatalog.addPartition.noCheckExists")) {
return;
}
return;
} else {
ErrorReport.reportDdlException(ErrorCode.ERR_SAME_NAME_PARTITION, partitionName);
}
@ -1575,7 +1573,6 @@ public class InternalCatalog implements CatalogIf<Database> {
if (!Strings.isNullOrEmpty(dataProperty.getStoragePolicy())) {
storagePolicy = dataProperty.getStoragePolicy();
}
boolean ignoreException = false;
try {
long partitionId = idGeneratorBuffer.getNextId();
Partition partition = createPartitionWithIndices(db.getId(), olapTable,
@ -1596,10 +1593,11 @@ public class InternalCatalog implements CatalogIf<Database> {
// check partition name
if (olapTable.checkPartitionNameExist(partitionName)) {
if (singlePartitionDesc.isSetIfNotExists()) {
ignoreException = true;
LOG.info("add partition[{}] which already exists", partitionName);
return;
} else {
ErrorReport.reportDdlException(ErrorCode.ERR_SAME_NAME_PARTITION, partitionName);
}
LOG.info("add partition[{}] which already exists", partitionName);
ErrorReport.reportDdlException(ErrorCode.ERR_SAME_NAME_PARTITION, partitionName);
}
// check if meta changed
@ -1644,6 +1642,8 @@ public class InternalCatalog implements CatalogIf<Database> {
}
}
if (metaChanged) {
throw new DdlException("Table[" + tableName + "]'s meta has been changed. try again.");
}
@ -1688,9 +1688,7 @@ public class InternalCatalog implements CatalogIf<Database> {
for (Long tabletId : tabletIdSet) {
Env.getCurrentInvertedIndex().deleteTablet(tabletId);
}
if (!ignoreException) {
throw e;
}
throw e;
}
}