[enhance](mtmv)when drop temp partition, not trigger materialized vie… (#40993)
…w refresh (#40875) pick: https://github.com/apache/doris/pull/40875
This commit is contained in:
@ -1889,7 +1889,7 @@ public class InternalCatalog implements CatalogIf<Database> {
|
||||
// it does not affect the logic of deleting the partition
|
||||
try {
|
||||
Env.getCurrentEnv().getEventProcessor().processEvent(
|
||||
new DropPartitionEvent(db.getCatalog().getId(), db.getId(), olapTable.getId()));
|
||||
new DropPartitionEvent(db.getCatalog().getId(), db.getId(), olapTable.getId(), isTempPartition));
|
||||
} catch (Throwable t) {
|
||||
// According to normal logic, no exceptions will be thrown,
|
||||
// but in order to avoid bugs affecting the original logic, all exceptions are caught
|
||||
|
||||
@ -20,7 +20,14 @@ package org.apache.doris.event;
|
||||
import org.apache.doris.common.AnalysisException;
|
||||
|
||||
public class DropPartitionEvent extends TableEvent {
|
||||
public DropPartitionEvent(long ctlId, long dbId, long tableId) throws AnalysisException {
|
||||
private boolean isTempPartition;
|
||||
|
||||
public DropPartitionEvent(long ctlId, long dbId, long tableId, boolean isTempPartition) throws AnalysisException {
|
||||
super(EventType.DROP_PARTITION, ctlId, dbId, tableId);
|
||||
this.isTempPartition = isTempPartition;
|
||||
}
|
||||
|
||||
public boolean isTempPartition() {
|
||||
return isTempPartition;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ import org.apache.doris.catalog.TableIf;
|
||||
import org.apache.doris.common.AnalysisException;
|
||||
import org.apache.doris.common.DdlException;
|
||||
import org.apache.doris.common.MetaNotFoundException;
|
||||
import org.apache.doris.event.DropPartitionEvent;
|
||||
import org.apache.doris.event.Event;
|
||||
import org.apache.doris.event.EventException;
|
||||
import org.apache.doris.event.EventListener;
|
||||
@ -177,6 +178,9 @@ public class MTMVService implements EventListener {
|
||||
if (!(event instanceof TableEvent)) {
|
||||
return;
|
||||
}
|
||||
if (event instanceof DropPartitionEvent && ((DropPartitionEvent) event).isTempPartition()) {
|
||||
return;
|
||||
}
|
||||
TableEvent tableEvent = (TableEvent) event;
|
||||
LOG.info("processEvent, Event: {}", event);
|
||||
TableIf table;
|
||||
|
||||
Reference in New Issue
Block a user