fix issue:

* [issue #662] Fix deadlocks caused by adding data using MySQL's REPLACE method
This commit is contained in:
Richard
2022-10-14 11:16:51 +08:00
committed by EricZeng
parent 5f21e5a728
commit 44134ce0d6
6 changed files with 38 additions and 6 deletions

View File

@@ -52,12 +52,10 @@ public abstract class AbstractHealthCheckTask extends AbstractAsyncMetricsDispat
resultList.addAll(this.checkAndGetResult(clusterPhyParam, healthConfigMap));
}
for (HealthCheckResult checkResult: resultList) {
try {
healthCheckResultService.replace(checkResult);
} catch (Exception e) {
log.error("class=AbstractHealthCheckTask||method=processSubTask||clusterPhyId={}||checkResult={}||errMsg=exception!", clusterPhy.getId(), checkResult, e);
}
try {
healthCheckResultService.batchReplace(clusterPhy.getId(), resultList);
} catch (Exception e) {
log.error("class=AbstractHealthCheckTask||method=processSubTask||clusterPhyId={}||errMsg=exception!", clusterPhy.getId(), e);
}
// 删除10分钟之前的检查结果