[inner-950] adjust the sequence of locks (cherry pick)

This commit is contained in:
wd2365151147
2022-02-21 15:44:50 +08:00
parent 5c718e788e
commit c63cada7d7
@@ -345,8 +345,6 @@ public class ServerConnection extends FrontendConnection {
String schema = rrs.getSchema();
String table = rrs.getTable();
try {
//lock self meta
ProxyMeta.getInstance().getTmManager().addMetaLock(schema, table, rrs.getSrcStatement());
if (ClusterGeneralConfig.isUseZK()) {
String nodeName = StringUtil.getFullName(schema, table);
String ddlPath = KVPathUtil.getDDLPath();
@@ -361,11 +359,12 @@ public class ServerConnection extends FrontendConnection {
} else if (ClusterGeneralConfig.isUseGeneralCluster()) {
ProxyMeta.getInstance().getTmManager().notifyClusterDDL(schema, table, rrs.getStatement());
}
//lock self meta
ProxyMeta.getInstance().getTmManager().addMetaLock(schema, table, rrs.getSrcStatement());
} catch (SQLNonTransientException e) {
throw e;
} catch (Exception e) {
ProxyMeta.getInstance().getTmManager().removeMetaLock(schema, table);
throw new SQLNonTransientException(e.toString() + ",sql:" + rrs.getStatement());
throw new SQLNonTransientException(e.getMessage() + ",sql:" + rrs.getStatement());
}
}