[fix](mtmv)fix thread local reference to checkpoint's Env, causing Env to be unable to be reclaimed, resulting in excessive memory usage by FE (#28723)
when replay addTaskResult log,will create one ConnectContext,and set Env.getCurrentEnv,then store this ctx in ConnectContext.threadLocalInfo,threadLocalInfo is static,so this ctx can not be recycling,Env of replay thread also can not be recycling
This commit is contained in:
@ -153,11 +153,13 @@ public class MTMV extends OlapTable {
|
||||
this.status.setSchemaChangeDetail(null);
|
||||
this.status.setRefreshState(MTMVRefreshState.SUCCESS);
|
||||
this.relation = relation;
|
||||
try {
|
||||
this.cache = MTMVCache.from(this, MTMVPlanUtil.createMTMVContext(this));
|
||||
} catch (Throwable e) {
|
||||
this.cache = null;
|
||||
LOG.warn("generate cache failed", e);
|
||||
if (!Env.isCheckpointThread()) {
|
||||
try {
|
||||
this.cache = MTMVCache.from(this, MTMVPlanUtil.createMTMVContext(this));
|
||||
} catch (Throwable e) {
|
||||
this.cache = null;
|
||||
LOG.warn("generate cache failed", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.status.setRefreshState(MTMVRefreshState.FAIL);
|
||||
|
||||
Reference in New Issue
Block a user