[improvement](transaction) txn prune memory after visible (#27128)

This commit is contained in:
yujun
2023-11-18 00:09:27 +08:00
committed by GitHub
parent fc47eb51f7
commit 2841c5cfd2
2 changed files with 7 additions and 0 deletions

View File

@ -173,6 +173,7 @@ public class PublishVersionDaemon extends MasterDaemon {
for (PublishVersionTask task : transactionState.getPublishVersionTasks().values()) {
AgentTaskQueue.removeTask(task.getBackendId(), TTaskType.PUBLISH_VERSION, task.getSignature());
}
transactionState.pruneAfterVisible();
if (MetricRepo.isInit) {
long publishTime = transactionState.getLastPublishVersionTime() - transactionState.getCommitTime();
MetricRepo.HISTO_TXN_PUBLISH_LATENCY.update(publishTime);

View File

@ -748,6 +748,12 @@ public class TransactionState implements Writable {
return this.errMsg;
}
// reduce memory
public void pruneAfterVisible() {
publishVersionTasks.clear();
tableIdToTotalNumDeltaRows.clear();
}
public void setSchemaForPartialUpdate(OlapTable olapTable) {
// the caller should hold the read lock of the table
isPartialUpdate = true;