[Bug] Fix thread safe problem when check whether olap table is stable (#5478)

This commit is contained in:
caiconghui
2021-03-10 19:12:00 +08:00
committed by GitHub
parent 620de71052
commit 079b764136

View File

@ -194,11 +194,11 @@ public abstract class AlterJobV2 implements Writable {
throw new AlterCancelException(e.getMessage());
}
boolean isStable = tbl.isStable(Catalog.getCurrentSystemInfo(),
Catalog.getCurrentCatalog().getTabletScheduler(), db.getClusterName());
tbl.writeLock();
try {
boolean isStable = tbl.isStable(Catalog.getCurrentSystemInfo(),
Catalog.getCurrentCatalog().getTabletScheduler(), db.getClusterName());
if (!isStable) {
errMsg = "table is unstable";
LOG.warn("wait table {} to be stable before doing {} job", tableId, type);